d7563da6ed0ae3b4541f28cbff5bbc082ba2b356
[shutils.git] / init.d / nsd-dynipwatch
1 #!/bin/sh -e
2 ### BEGIN INIT INFO
3 # Provides: nsd-dynipwatch
4 # Required-Start: $nsd3
5 # Required-Stop: $nsd3
6 # Should-Start: $local_fs
7 # Should-Stop: $local_fs
8 # Default-Start: 2 3 4 5
9 # Default-Stop: 0 1 6
10 # Short-Description: Start nsd dynip update
11 # Description: Provides an updater for NSD3 zone files
12 ### END INIT INFO
13
14
15
16 . /lib/lsb/init-functions
17
18 PIDFILE=/var/run/nsd-dynipwatch.pid
19 ARGS="/etc/nsd3/sthu.org.zone euklid"
20
21 case "$1" in
22 start)
23 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --exec /usr/local/bin/nsd-dynipwatch -- $ARGS
24 ;;
25 stop)
26 start-stop-daemon --stop --quiet --pidfile $PIDFILE
27 ;;
28 restart)
29 start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
30 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --exec /usr/local/bin/nsd-dynipwatch -- $ARGS
31 ;;
32 status)
33 status_of_proc -p $PIDFILE /usr/local/bin/nsd-dynipwatch nsd-dynipwatch && exit 0 || exit $?
34 ;;
35 *)
36 log_action_msg "Usage: /etc/init.d/cron {start|stop|restart}"
37 exit 2
38 ;;
39 esac
40 exit 0
41