updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / monkey-git / monkey
blob084af51f380faf65bee96cfbb4af9fe64701c695
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=monkey
8 PID=$(get_pid $DAEMON)
10 case "$1" in
11 start)
12 stat_busy "Starting $DAEMON"
13 [[ -z "$PID" ]] && /usr/bin/monkey -D &>/dev/null \
14 && { add_daemon $DAEMON; stat_done; } \
15 || { stat_fail; exit 1; }
17 stop)
18 stat_busy "Stopping $DAEMON"
19 [[ ! -z "$PID" ]] && kill $PID &>/dev/null \
20 && { rm_daemon $DAEMON; stat_done; } \
21 || { stat_fail; exit 1; }
23 restart)
24 $0 stop
25 sleep 1
26 $0 start
29 echo "usage: $0 {start|stop|restart}"
31 esac
32 exit 0