updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / pmacct / pmacctd.rc.d
bloba90ca54e07b6f792d72ea9d235f2aebb9cf099bc
1 #!/bin/bash
3 CONF=/etc/pmacct/pmacctd.conf
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 [ -f $CONF ]
10 PID=$(pidof -o %PPID /usr/sbin/pmacctd)
11 case "$1" in
12 start)
13 stat_busy "Starting pmacct libpcap Accounting Daemon"
14 [ -z "$PID" ] && /usr/sbin/pmacctd -f $CONF
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon pmacctd
19 stat_done
22 stop)
23 stat_busy "Stopping pmacct libpcap Accounting Daemon"
24 [ ! -z "$PID" ] && kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon pmacctd
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