96963591fc080cedcc0e6d0ff00c3613c0a8ff8c
[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 IPFILE=/tmp/euklid.ip
20 ARGS="/etc/nsd3/sthu.org.zone euklid ${IPFILE}"
21
22 case "$1" in
23 start)
24 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --exec /usr/local/bin/nsd-dynipwatch -- $ARGS
25 ;;
26 stop)
27 start-stop-daemon --stop --quiet --pidfile $PIDFILE
28 ;;
29 restart)
30 start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
31 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --exec /usr/local/bin/nsd-dynipwatch -- $ARGS
32 ;;
33 status)
34 status_of_proc -p $PIDFILE /usr/local/bin/nsd-dynipwatch nsd-dynipwatch && exit 0 || exit $?
35 ;;
36 *)
37 log_action_msg "Usage: /etc/init.d/cron {start|stop|restart}"
38 exit 2
39 ;;
40 esac
41 exit 0
42