updated on Sun Jan 15 20:01:04 UTC 2012
[aur-mirror.git] / spampd / rc-script
blob7c4b0591b16192f191d04ddaa6f680ebdd7ed7dd
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/spampd
7 start() {
8 stat_busy "Starting Spampd"
9 su -l spampd -c "/usr/bin/spampd $ARGS"
10 if [ $? -gt 0 ]; then
11 stat_fail
12 else
13 add_daemon spampd
14 stat_done
18 stop() {
19 stat_busy "Stopping Spampd"
20 kill $(cat /home/spampd/spampd.pid)
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 rm_daemon spampd
25 stat_done
29 case "$1" in
30 start)
31 start
33 stop)
34 stop
36 restart)
37 # calling 'stop' and 'start' without the $0 fails...
38 $0 stop
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac
44 exit 0