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