[packages] ddns_scripts: use network_get_ipaddr() to determine currently effective IP from ip_network
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31939 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
8e475b8179
commit
d671785a36
@ -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)
|
||||
|
||||
|
@ -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" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user