updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / quassel-indicator / rc.quassel
blob99b82eec9584e4c28fc44c7853ed68238795d972
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/quassel
7 PIDFILE=/var/run/quassel.pid
8 PID=`pidof -o %PPID /usr/bin/quasselcore`
10 case "$1" in
11 start)
12 stat_busy "Starting Quassel Core"
13 [ -z "$PID" ] && su -l -c "/usr/bin/quasselcore --configdir=/var/lib/quassel --listen=$LISTEN &" $QUASSEL_USER &>/dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 echo $PID > $PIDFILE
18 add_daemon quassel
19 stat_done
22 stop)
23 stat_busy "Stopping Quassel Core"
24 [ ! -z "$PID" ] && kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm -f $PIDFILE
29 rm_daemon quassel
30 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0