updated on Tue Jan 10 08:08:34 UTC 2012
[aur-mirror.git] / goagent-git / daemon.goagent
blob26799aaaba4fb557ec300e27cd56772609f937b4
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`cat /var/run/goagent.pid 2>/dev/null`
7 case "$1" in
8 start)
9 stat_busy "Starting goagent"
10 if [ -z "$PID" ]; then
11 /opt/goagent/local/proxy.py &> /var/log/goagent.log &
12 echo $! > /var/run/goagent.pid
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon goagent
18 stat_done
21 stop)
22 stat_busy "Stopping goagent"
23 if [ ! -z "$PID" ]; then
24 kill $PID &> /dev/null
25 rm /var/run/goagent.pid
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon goagent
31 stat_done
34 restart)
35 $0 stop
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0