updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / wimax-network-service / wimaxd.rc
blobbb960ce2738db80b05dd350bb6fad55131790482
1 #!/bin/bash
3 daemon_name=wimaxd
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 case "$1" in
9 start)
10 stat_busy "Starting $daemon_name daemon"
11 if [ ! -f /var/run/$daemon_name.wmx0.pid ] && $daemon_name -b &>/dev/null; then
12 add_daemon $daemon_name
13 stat_done
14 else
15 stat_fail
16 exit 1
20 stop)
21 stat_busy "Stopping $daemon_name daemon"
22 [ -f /var/run/$daemon_name.wmx0.pid ] && read PID </var/run/$daemon_name.wmx0.pid
23 if kill $PID &>/dev/null; then
24 rm_daemon $daemon_name
25 stat_done
26 else
27 stat_fail
28 exit 1
32 restart)
33 stat_busy "Restarting $daemon_name daemon"
34 [ -f /var/run/$daemon_name.wmx0.pid ] && read PID </var/run/$daemon_name.wmx0.pid
35 if kill -USR1 $PID &>/dev/null; then
36 add_daemon $daemon_name
37 stat_done
38 else
39 stat_fail
40 exit 1
44 status)
45 stat_busy "Checking $daemon_name status";
46 ck_status $daemon_name
50 echo "usage: $0 {start|stop|restart|status}"
51 esac
53 exit 0