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