[packages] ddns-scripts: add an option to specify the used interface - default to wan to retain compatibility (#7570)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@27657 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
a881d0cb3b
commit
7e7620331b
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=ddns-scripts
|
PKG_NAME:=ddns-scripts
|
||||||
PKG_VERSION:=1.0.0
|
PKG_VERSION:=1.0.0
|
||||||
PKG_RELEASE:=14
|
PKG_RELEASE:=15
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
config service "myddns"
|
config service "myddns"
|
||||||
option enabled "0"
|
option enabled "0"
|
||||||
|
option interface "wan"
|
||||||
|
|
||||||
option service_name "dyndns.org"
|
option service_name "dyndns.org"
|
||||||
option domain "mypersonaldomain.dyndns.org"
|
option domain "mypersonaldomain.dyndns.org"
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
. /usr/lib/ddns/dynamic_dns_functions.sh
|
. /usr/lib/ddns/dynamic_dns_functions.sh
|
||||||
|
|
||||||
if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
|
if [ "$ACTION" = "ifup" ]; then
|
||||||
then
|
start_daemon_for_all_ddns_sections "$INTERFACE"
|
||||||
start_daemon_for_all_ddns_sections
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,6 +110,8 @@ verbose_echo()
|
|||||||
|
|
||||||
start_daemon_for_all_ddns_sections()
|
start_daemon_for_all_ddns_sections()
|
||||||
{
|
{
|
||||||
|
local event_interface="$1"
|
||||||
|
|
||||||
SECTIONS=""
|
SECTIONS=""
|
||||||
config_cb()
|
config_cb()
|
||||||
{
|
{
|
||||||
@ -119,6 +121,9 @@ start_daemon_for_all_ddns_sections()
|
|||||||
|
|
||||||
for section in $SECTIONS
|
for section in $SECTIONS
|
||||||
do
|
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 &
|
/usr/lib/ddns/dynamic_dns_updater.sh $section 0 > /dev/null 2>&1 &
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user