-
Notifications
You must be signed in to change notification settings - Fork 31
/
softflowd.init
67 lines (59 loc) · 1.08 KB
/
softflowd.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#
# softflowd Starts softflowd NetFlow probe
#
# chkconfig: 2345 95 02
# description: Starts and stops the softflowd Netflow probe
# Source function library.
. /etc/init.d/functions
SOFTFLOW_CONF=/etc/sysconfig/softflowd
SOFTFLOW_LOCK=/var/lock/subsys/softflowd
SOFTFLOW_PROG=/usr/sbin/softflowd
SOFTFLOW_OPTS="-i eth0"
# Source config
if [ -f $SOFTFLOW_CONF ]; then
. $SOFTFLOW_CONF
fi
[ -x $SOFTFLOW_PROG ] || exit 0
RETVAL=0
start() {
echo -n $"Starting softflowd: "
daemon $SOFTFLOW_PROG $SOFTFLOW_OPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $SOFTFLOW_LOCK
return $RETVAL
}
stop() {
echo -n $"Shutting down softflowd: "
killproc $SOFTFLOW_PROG
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $SOFTFLOW_LOCK
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $SOFTFLOW_PROG
;;
restart|reload)
restart
;;
condrestart)
[ -f $SOFTFLOW_LOCK ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $?