updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / bfilter / bfilterd
blob15a81ab93d5416d0a7ec6691293eef5dce231055
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/bin/bfilter`
7 case "$1" in
8 start)
9 stat_busy "Starting BFilter Daemon"
10 [ -z "$PID" ] && /usr/bin/bfilter -u bfilter -g bfilter -c /etc/bfilter
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 echo $PID > /var/run/bfilter.pid
15 add_daemon bfilter
16 stat_done
19 stop)
20 stat_busy "Stopping BFilter Daemon"
21 [ ! -z "$PID" ] && kill $PID &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm /var/run/bfilter.pid
26 rm_daemon bfilter
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0