[packages] ddns_scripts: use network_get_ipaddr() to determine currently effective...
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 28 May 2012 03:38:44 +0000 (03:38 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 28 May 2012 03:38:44 +0000 (03:38 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31939 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

index 2b4edec..5a99d8d 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=1.0.0
-PKG_RELEASE:=19
+PKG_RELEASE:=20
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index ba18c8b..3d435d3 100644 (file)
@@ -8,8 +8,8 @@
 
 
 
-. /etc/functions.sh
-include /lib/network
+. /lib/functions.sh
+. /lib/functions/network.sh
 
 
 #loads all options for a given package and section
@@ -64,13 +64,13 @@ get_current_ip()
                then
                        ip_network="wan"
                fi
-               scan_interfaces
-               config_load /var/state/network
-               config_get ip_interface $ip_network ifname
        fi
 
        current_ip='';
-       if [ "$ip_source" = "network" ] || [ "$ip_source" = "interface" ]
+       if [ "$ip_source" = "network" ]
+       then
+               network_get_ipaddr current_ip "$ip_network" || return
+       elif [ "$ip_source" = "interface" ]
        then
                current_ip=$(ifconfig $ip_interface | grep -o 'inet addr:[0-9.]*' | grep -o "$ip_regex")
        elif [ "$ip_source" = "script" ]