[packages] ddns_scripts: use network_get_ipaddr() to determine currently effective...
authorJo-Philipp Wich <[email protected]>
Mon, 28 May 2012 03:38:44 +0000 (03:38 +0000)
committerJo-Philipp Wich <[email protected]>
Mon, 28 May 2012 03:38:44 +0000 (03:38 +0000)
SVN-Revision: 31939

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

index 2b4edec5cfc57ec3de9e6ead94ad4699a591c970..5a99d8d08185950b8774541a6c869f9b480c85e8 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 ba18c8b1c4a852b8d6fbe8dbc77af315c50e04a4..3d435d3e726a4eae9c7880badaaa1c0625b667eb 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" ]