updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pmacct / sfacctd.rc.d
blob9af03e84c1f467f318cf7ca946c74b1d4fc00a2e
1 #!/bin/bash
3 CONF=/etc/pmacct/sfacctd.conf
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 [ -f $CONF ]
10 PID=$(pidof -o %PPID /usr/sbin/sfacctd)
11 case "$1" in
12 start)
13 stat_busy "Starting pmacct sFlow Accounting Daemon"
14 [ -z "$PID" ] && /usr/sbin/sfacctd -f $CONF
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon sfacctd
19 stat_done
22 stop)
23 stat_busy "Stopping pmacct sFlow Accounting Daemon"
24 [ ! -z "$PID" ] && kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon sfacctd
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac
40 exit 0