updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / quasselcore-git / quasselcore.rcscript
blob82b0765ff4c46b8d59874eeb67b422e9b6b9a596
1 #!/bin/bash
2 . /etc/rc.conf
3 . /etc/rc.d/functions
5 QUASSELCORE_USER="quassel"
6 QUASSELCORE_ARGS="-c /home/$QUASSELCORE_USER/.config/quassel-irc.org/"
7 PID=`pidof -o %PPID /usr/bin/quasselcore`
9 case "$1" in
10 start)
11 stat_busy "Starting Quassel core"
12 [ -z "$PID" ] && sudo -u $QUASSELCORE_USER /usr/bin/quasselcore $QUASSELCORE_ARGS &>/dev/null &
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon quasselcore
17 stat_done
20 stop)
21 stat_busy "Stopping Quassel core"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon quasselcore
27 stat_done
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0