All pastes #627532 Raw Edit

Unbenannt

public text v1 · immutable
·published 2007-07-20 11:55 UTC
rendered paste body
ubuntu@ubuntu-laptop:~$ svn status updatedd/
D      updatedd/files/ddns.hotplug
D      updatedd/files/ddns.init
A  +   updatedd/files/updatedd.hotplug
D      updatedd/files/ddns.config
A  +   updatedd/files/updatedd.init
A  +   updatedd/files/updatedd.config
M      updatedd/Makefile
ubuntu@ubuntu-laptop:~$ svn diff updatedd/
Index: updatedd/files/ddns.hotplug
===================================================================
--- updatedd/files/ddns.hotplug (Revision 8071)
+++ updatedd/files/ddns.hotplug (Arbeitskopie)
@@ -1,15 +0,0 @@
-NAME=updatedd
-CONFIG=/etc/config/$NAME
-COMMAND=/usr/bin/$NAME
-
-[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
-        [ -x $COMMAND ] && [ -r $CONFIG ] && {
-                                include /lib/network
-                                scan_interfaces
-
-                                config_get ifname wan ifname
-                                [ -n "$ifname" ] && {
-                                       /etc/init.d/ddns restart
-                               }
-        } &
-}
Index: updatedd/files/ddns.init
===================================================================
--- updatedd/files/ddns.init    (Revision 8071)
+++ updatedd/files/ddns.init    (Arbeitskopie)
@@ -1,27 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-START=50
-
-. /etc/functions.sh
-
-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
-
-start() {
-       [ "$ddns_update" = 1 ] && {
-               /usr/bin/updatedd -Y $ddns_service -- $ddns_user:$ddns_passwd $ddns_host
-       }
-}
-
-stop() {
-       killall updatedd
-}
-
-restart() {
-       stop
-       start
-}
Index: updatedd/files/ddns.config
===================================================================
--- updatedd/files/ddns.config  (Revision 8071)
+++ updatedd/files/ddns.config  (Arbeitskopie)
@@ -1,6 +0,0 @@
-config updatedd
-        option ddns_service     ''
-        option ddns_user        ''
-        option ddns_passwd      ''
-        option ddns_host        ''
-        option ddns_update      '0'
Index: updatedd/files/updatedd.init
===================================================================
--- updatedd/files/updatedd.init        (Revision 8071)
+++ updatedd/files/updatedd.init        (Arbeitskopie)
@@ -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/updatedd.config
===================================================================
--- updatedd/files/updatedd.config      (Revision 8071)
+++ updatedd/files/updatedd.config      (Arbeitskopie)
@@ -1,6 +1,13 @@
 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'
+
+config updatedd
+        option service     ''
+        option user        ''
+        option passwd      ''
+        option host        ''
+        option update      '0'
Index: updatedd/Makefile
===================================================================
--- updatedd/Makefile   (Revision 8071)
+++ updatedd/Makefile   (Arbeitskopie)
@@ -119,14 +119,14 @@
 
 define Package/updatedd/install
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/ddns.init $(1)/etc/init.d/ddns
+       $(INSTALL_BIN) ./files/updatedd.init $(1)/etc/init.d/updatedd
        $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DATA) ./files/ddns.config $(1)/etc/config/updatedd
+       $(INSTALL_DATA) ./files/updatedd.config $(1)/etc/config/updatedd
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/updatedd $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/lib/updatedd
        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/ddns.hotplug $(1)/etc/hotplug.d/iface/30-ddns
+       $(INSTALL_BIN) ./files/updatedd.hotplug $(1)/etc/hotplug.d/iface/30-updatedd
 endef
 
 $(eval $(call BuildPackage,updatedd))