updatedd:
authorOliver Ertl <oliver@ertl-net.net>
Fri, 20 Jul 2007 12:15:36 +0000 (12:15 +0000)
committerOliver Ertl <oliver@ertl-net.net>
Fri, 20 Jul 2007 12:15:36 +0000 (12:15 +0000)
 * Update the init script and config file to use multiple updates
 * Cleanup the Makefile

SVN-Revision: 8072

net/updatedd/Makefile
net/updatedd/files/ddns.config [deleted file]
net/updatedd/files/ddns.hotplug [deleted file]
net/updatedd/files/ddns.init [deleted file]
net/updatedd/files/updatedd.config [new file with mode: 0644]
net/updatedd/files/updatedd.hotplug [new file with mode: 0644]
net/updatedd/files/updatedd.init [new file with mode: 0644]

index 9c2ec368041132a86b8d8ea68bf604afc8599c55..28bda335c007f14d2625e7976d1e9aeac30c1423 100644 (file)
@@ -10,12 +10,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=updatedd
 PKG_VERSION:=2.5
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_MD5SUM:=2957496de0c8e08e9c6492fabf1a88be
 
 PKG_SOURCE_URL:=http://savannah.nongnu.org/download/updatedd/
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
-PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
@@ -103,10 +102,9 @@ define Package/updatedd-mod-zoneedit
   TITLE:=zoneedit.com
 endef
 
-define Build/Compile
-$(call Build/Compile/Default,DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install)
-endef
+MAKE_FLAGS += \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       all install
 
 define BuildPlugin
   define Package/$(1)/install
@@ -119,14 +117,14 @@ endef
 
 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))
diff --git a/net/updatedd/files/ddns.config b/net/updatedd/files/ddns.config
deleted file mode 100644 (file)
index bb6ed4a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-config updatedd
-        option ddns_service     ''
-        option ddns_user        ''
-        option ddns_passwd      ''
-        option ddns_host        ''
-        option ddns_update      '0'
diff --git a/net/updatedd/files/ddns.hotplug b/net/updatedd/files/ddns.hotplug
deleted file mode 100644 (file)
index 78ede40..0000000
+++ /dev/null
@@ -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
-                               }
-        } &
-}
diff --git a/net/updatedd/files/ddns.init b/net/updatedd/files/ddns.init
deleted file mode 100644 (file)
index bfd873d..0000000
+++ /dev/null
@@ -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
-}
diff --git a/net/updatedd/files/updatedd.config b/net/updatedd/files/updatedd.config
new file mode 100644 (file)
index 0000000..72b1c9e
--- /dev/null
@@ -0,0 +1,6 @@
+config updatedd
+        option service     ''
+        option user        ''
+        option passwd      ''
+        option host        ''
+        option update      '0'
diff --git a/net/updatedd/files/updatedd.hotplug b/net/updatedd/files/updatedd.hotplug
new file mode 100644 (file)
index 0000000..82efbf9
--- /dev/null
@@ -0,0 +1,15 @@
+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/updatedd restart
+                               }
+        } &
+}
diff --git a/net/updatedd/files/updatedd.init b/net/updatedd/files/updatedd.init
new file mode 100644 (file)
index 0000000..ff15737
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=50
+
+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
+
+       [ "$update" = 1 ] && {
+               /usr/bin/updatedd -Y $service -- $user:$passwd $host
+       }
+}
+
+start() {
+       config_load "updatedd"
+       config_foreach start_service updatedd
+}
+
+stop() {
+       killall updatedd
+}
+
+restart() {
+       stop
+       start
+}