[packages] ddns-scripts: add an option to specify the used interface - default to...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 17 Jul 2011 17:56:04 +0000 (17:56 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 17 Jul 2011 17:56:04 +0000 (17:56 +0000)
SVN-Revision: 27657

net/ddns-scripts/Makefile
net/ddns-scripts/files/etc/config/ddns
net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

index 108627b8a1ed3a3ca5c74f2caf310190c104ca23..c67508bd3b83aa7cf679a7cad22768a07104c88f 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=1.0.0
-PKG_RELEASE:=14
+PKG_RELEASE:=15
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index 2545215ed6e28d931673f00cceb6ac1b810ec744..db84aaeeab172880ac25037e6fa7c61be89a3b08 100644 (file)
@@ -62,6 +62,7 @@
 
 config service "myddns"
        option enabled          "0"
+       option interface        "wan"
 
        option service_name     "dyndns.org"
        option domain           "mypersonaldomain.dyndns.org"
index 4b543eb917507c7274498747d2a82d8935020a44..4495b5d85464d074005b918ee33757483aadcfd2 100644 (file)
@@ -2,9 +2,8 @@
 
 . /usr/lib/ddns/dynamic_dns_functions.sh
 
-if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
-then
-       start_daemon_for_all_ddns_sections
+if [ "$ACTION" = "ifup" ]; then
+       start_daemon_for_all_ddns_sections "$INTERFACE"
 fi
 
 
index 19effeffae72b872acb10cfd71ee8997842f6bce..ba18c8b1c4a852b8d6fbe8dbc77af315c50e04a4 100644 (file)
@@ -110,6 +110,8 @@ verbose_echo()
 
 start_daemon_for_all_ddns_sections()
 {
+       local event_interface="$1"
+
        SECTIONS=""
        config_cb() 
        {
@@ -119,6 +121,9 @@ start_daemon_for_all_ddns_sections()
 
        for section in $SECTIONS
        do
+               local iface
+               config_get iface "$section" interface "wan"
+               [ "$iface" = "$event_interface" ] || continue
                /usr/lib/ddns/dynamic_dns_updater.sh $section 0 > /dev/null 2>&1 &
        done
 }