updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pyirc-ssl / pyirc-ssl.rc
blob68dc534df5dd4ec288c76ba5e6f6241ed0236b52
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 get_pid() {
7 [ -f /var/run/pyirct-ssl.pid ] && echo `cat /var/run/pyirct-ssl.pid`
10 case "$1" in
11 start)
12 stat_busy "Starting jabber IRC-SSL transport daemon"
14 [ -f /var/run/pyirct-ssl.pid ] && rm -f /var/run/pyirct-ssl.pid
15 PID=`get_pid`
16 if [ -z "$PID" ]; then
17 cd /usr/lib/pyirc-ssl && python2 ./irc.py 1>/dev/null 2>/dev/null &
18 if [ $? -gt 0 ]; then
19 stat_fail
20 exit 1
21 else
22 add_daemon pyirct-ssl
23 stat_done
25 else
26 stat_fail
27 exit 1
31 stop)
32 stat_busy "Stopping jabber IRC-SSL transport daemon"
33 PID=`get_pid`
34 [ ! -z "$PID" ] && kill $PID &> /dev/null
35 if [ $? -gt 0 ]; then
36 stat_fail
37 exit 1
38 else
39 rm -f /var/run/pyirct-ssl.pid &> /dev/null
40 rm_daemon pyirct-ssl
41 stat_done
45 restart)
46 $0 stop
47 sleep 3
48 $0 start
51 echo "usage: $0 {start|stop|restart}"
52 esac
53 exit 0