updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ircd-ratbox-testing / ircd
blob3aefcb663ad3b29398eeb6184ef2e6e1ad33774d
1 #!/bin/bash
3 NAME=ircd
4 DAEMON=/usr/sbin/ircd
5 PIDFILE=/var/run/$NAME.pid
7 . /etc/rc.conf
8 . /etc/rc.d/functions
10 PID=`pidof -o %PPID $DAEMON`
11 case "$1" in
12 start)
13 stat_busy "Starting ircd-ratbox"
14 [ -z "$PIDFILE" ] && `su ircd -c "$DAEMON"`
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 PID=`pidof -o %PPID $DAEMON`
19 echo $PID > $PIDFILE
20 add_daemon $NAME
21 stat_done
24 stop)
25 stat_busy "Stopping ircd-ratbox"
26 PID=`cat $PIDFILE`
27 kill $PID > /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm $PIDFILE
32 rm_daemon $NAME
33 stat_done
36 restart|force-reload)
37 $0 stop
38 $0 start
40 config-test)
41 `su ircd -c "$DAEMON -conftest"`
44 echo "usage: $0 {start|stop|restart|config-test}"
45 esac
46 exit 0