File: softflowd.init

package info (click to toggle)
softflowd 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 680 kB
  • sloc: ansic: 5,321; sh: 634; perl: 196; makefile: 43
file content (67 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (4)
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 $?