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