updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / ndyndns / ndyndns
bloba639eeeb863569d6f573dc4a5dae6085e6ea2b5f
1 #!/bin/bash
3 daemon_name=ndyndns
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 PID=/var/run/${daemon_name}.pid
10 case "$1" in
11 start)
12 stat_busy "Starting ${daemon_name} daemon"
13 [[ -f ${PID} ]] && rm -f ${PID}
14 /usr/sbin/ndyndns -f /etc/ndyndns.conf -x
15 if [[ $? -gt 0 ]]; then
16 stat_fail
17 exit 1
18 else
19 add_daemon ${daemon_name}
20 stat_done
24 stop)
25 stat_busy "Stopping ${daemon_name} daemon"
26 [[ -n $(cat ${PID} 2>/dev/null) ]] && kill $(cat ${PID})
27 if [[ $? -gt 0 ]]; then
28 stat_fail
29 exit 1
30 else
31 rm -f ${PID}
32 rm_daemon ${daemon_name}
33 stat_done
37 restart)
38 $0 stop
39 sleep 3
40 $0 start
43 status)
44 stat_busy "Checking ${daemon_name} status"
45 ck_status ${daemon_name}
49 echo "usage: $0 {start|stop|restart|status}"
50 esac
52 exit 0