Convert updatedd to the uci config format, add a hotplug script as well (#1213)
[openwrt/svn-archive/archive.git] / net / updatedd / files / ddns.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 . /etc/functions.sh
5
6 config_load updatedd
7 config_get ddns_service cfg1 ddns_service
8 config_get ddns_user cfg1 ddns_user
9 config_get ddns_passwd cfg1 ddns_passwd
10 config_get ddns_host cfg1 ddns_host
11 config_get ddns_update cfg1 ddns_update
12
13 start() {
14 [ "$ddns_update" = 1 ] && {
15 /usr/bin/updatedd -Y $ddns_service -- $ddns_user:$ddns_passwd $ddns_host
16 }
17 }
18
19 stop() {
20 killall updatedd
21 }
22
23 restart() {
24 stop
25 start
26 }