rendered paste bodyIndex: updatedd/files/ddns.init
===================================================================
--- updatedd/files/ddns.init (revision 8071)
+++ updatedd/files/ddns.init (working copy)
@@ -2,19 +2,22 @@
# Copyright (C) 2006 OpenWrt.org
START=50
-. /etc/functions.sh
+start_service () {
+ local section="$1"
+ config_get service "$section" service
+ config_get user "$section" user
+ config_get passwd "$section" passwd
+ config_get host "$section" host
+ config_get update "$section" update
-config_load updatedd
-config_get ddns_service cfg1 ddns_service
-config_get ddns_user cfg1 ddns_user
-config_get ddns_passwd cfg1 ddns_passwd
-config_get ddns_host cfg1 ddns_host
-config_get ddns_update cfg1 ddns_update
+ [ "$update" = 1 ] && {
+ /usr/bin/updatedd -Y $service -- $user:$passwd $host
+ }
+}
start() {
- [ "$ddns_update" = 1 ] && {
- /usr/bin/updatedd -Y $ddns_service -- $ddns_user:$ddns_passwd $ddns_host
- }
+ config_load "updatedd"
+ config_foreach start_service updatedd
}
stop() {
Index: updatedd/files/ddns.config
===================================================================
--- updatedd/files/ddns.config (revision 8071)
+++ updatedd/files/ddns.config (working copy)
@@ -1,6 +1,6 @@
config updatedd
- option ddns_service ''
- option ddns_user ''
- option ddns_passwd ''
- option ddns_host ''
- option ddns_update '0'
+ option service ''
+ option user ''
+ option passwd ''
+ option host ''
+ option update '0'