updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / netkit-rwho-debian / rwhod.rc
blobf165c62955b987fc4476bc83348f23c964eac9a7
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/rwhod
7 PID=`pidof -o %PPID /usr/sbin/rwhod`
8 case "$1" in
9 start)
10 stat_busy "Starting Remote WHO Daemon"
11 if [ -z "$PID" ]; then
12 /usr/sbin/rwhod $RWHOD_OPTS &
14 if [ ! -z "$PID" ]; then
15 stat_fail
16 else
17 PID=`pidof -o %PPID /usr/sbin/rwhod`
18 echo $PID > /var/run/rwhod.pid
19 add_daemon rwhod
20 stat_done
23 stop)
24 stat_busy "Stopping Remote WHO Daemon"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon rwhod
30 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac