updated on Mon Jan 23 16:10:15 UTC 2012
[aur-mirror.git] / inspircd / inspircd.rcd
bloba041b9be4cfdf92ed0fd389e9ba5bea11769f1ea
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 get_pid() {
7 pidof /usr/sbin/inspircd
10 case "$1" in
11 start)
12 stat_busy "Starting inspircd"
13 PID=$(get_pid)
14 if [ -z "$PID" ]; then
15 su -s /bin/sh -c '/usr/sbin/inspircd --logfile /var/log/inspircd/startup.log --config /etc/inspircd/inspircd.conf' 'inspircd' > /dev/null
16 if [ $? -gt 0 ]; then
17 stat_fail
18 exit 1
19 else
20 add_daemon inspircd
21 stat_done
23 else
24 stat_fail
25 exit 1
29 stop)
30 stat_busy "Stopping inspircd"
31 PID=$(get_pid)
32 [ ! -z "$PID" ] && kill $PID
33 if [ $? -gt 0 ]; then
34 stat_fail
35 exit 1
36 else
37 rm_daemon inspircd
38 stat_done
42 restart)
43 $0 stop
44 $0 start
48 echo "usage: $0 {start|stop|restart}"
49 esac
50 exit 0