Skip to content

Commit 4a41ba0

Browse files
committed
Example init.d file
1 parent def7de5 commit 4a41ba0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

rc.autoddns

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/sh
2+
3+
test -x /usr/local/sbin/autoddns || exit 0
4+
5+
AUTODDNS_OPTS="-t 3600 -i eth0 -- nsupdate -k /usr/local/etc/Khostname.+9999+9999.private"
6+
7+
case "$1" in
8+
start)
9+
echo -n "Starting Automatic DDNS updater: autoddns"
10+
start-stop-daemon --start --quiet --exec /usr/local/sbin/autoddns -- $AUTODDNS_OPTS
11+
echo "."
12+
;;
13+
stop)
14+
echo -n "Stopping Automatic DDNS updater: autoddns"
15+
start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/autoddns
16+
echo "."
17+
;;
18+
restart|reload|force-reload)
19+
echo -n "Restarting Automatic DDNS updater: autoddns"
20+
start-stop-daemon --stop --quiet --exec /usr/local/sbin/autoddns
21+
start-stop-daemon --start --quiet --exec /usr/local/sbin/autoddns -- $AUTODDNS_OPTS
22+
echo "."
23+
;;
24+
*)
25+
echo "Usage: /etc/init.d/autoddns {start|stop|restart}"
26+
exit 1
27+
esac
28+
29+
exit 0

0 commit comments

Comments
 (0)