updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / isida-svn / isida.rc
blob613a025c34c871f031b6dc7e521e7bcfe384e9a5
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 get_pid() {
7 echo `ps h -U isida -opid`
10 case "$1" in
11 start)
12 stat_busy "Starting iSida jabber bot"
13 PID=`get_pid`
14 if [ -z "$PID" ]; then
15 su isida -s /bin/bash - -c 'cd /usr/share/isida && svn up && echo `svnversion` > settings/version && python2.5 start.py' 1>/dev/null 2>/dev/null &
16 if [ $? -gt 0 ]; then
17 stat_fail
18 exit 1
19 else
20 add_daemon isida
21 echo `get_pid` > /var/run/isida.pid
22 stat_done
24 else
25 stat_fail
26 exit 1
29 stop)
30 stat_busy "Stopping iSida jabber bot"
31 PID=`get_pid`
32 [ ! -z "$PID" ] && kill $PID &> /dev/null
33 if [ $? -gt 0 ]; then
34 stat_fail
35 exit 1
36 else
37 rm -f /var/run/isida.pid &> /dev/null
38 rm_daemon isida
39 stat_done
43 restart)
44 $0 stop
45 sleep 3
46 $0 start
49 echo "usage: $0 {start|stop|restart}"
50 esac
51 exit 0