commit 2c4e5df48a59423677478de70ba64d2d4b05a4ff
parent 2d606f93e47aee421e9a14465c0a6ad3c24c16fd
Author: Hannu Nyman <hannu.nyman@iki.fi>
Date: Mon, 5 Dec 2016 21:48:48 +0200
Merge pull request #3622 from chris5560/master
ddns-scripts: various fixes
Diffstat:
5 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile
@@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
PKG_VERSION:=2.7.6
# Release == build
# increase on changes of services files or tld_names.dat
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
diff --git a/net/ddns-scripts/files/ddns.config b/net/ddns-scripts/files/ddns.config
@@ -2,11 +2,11 @@
# Please read http://wiki.openwrt.org/doc/uci/ddns
#
config ddns "global"
- option date_format "%F %R"
-# option run_dir "/var/run/ddns"
-# option log_dir "/var/log/ddns"
- option log_lines "250"
- option allow_local_ip "0"
+ option ddns_dateformat "%F %R"
+# option ddns_rundir "/var/run/ddns"
+# option ddns_logdir "/var/log/ddns"
+ option ddns_loglines "250"
+ option upd_privateip "0"
config service "myddns_ipv4"
diff --git a/net/ddns-scripts/files/dynamic_dns_functions.sh b/net/ddns-scripts/files/dynamic_dns_functions.sh
@@ -63,7 +63,7 @@ IPV4_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
IPV6_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)"
# detect if called by ddns-lucihelper.sh script, disable retrys (empty variable == false)
-[ "$MYPROG" = "ddns-lucihelper.sh" ] && LUCI_HELPER="TRUE" || LUCI_HELPER=""
+LUCI_HELPER=$(printf %s "$MYPROG" | grep -i "luci")
# Name Server Lookup Programs
BIND_HOST=$(which host)
@@ -181,7 +181,11 @@ start_daemon_for_all_ddns_sections()
for __SECTIONID in $__SECTIONS; do
config_get __IFACE "$__SECTIONID" interface "wan"
[ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
- /usr/lib/ddns/dynamic_dns_updater.sh -v "0" -S "$__SECTIONID" -- start
+ if [ $VERBOSE -eq 0 ]; then # start in background
+ /usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start &
+ else
+ /usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start
+ fi
done
}
diff --git a/net/ddns-scripts/files/dynamic_dns_lucihelper.sh b/net/ddns-scripts/files/dynamic_dns_lucihelper.sh
@@ -146,7 +146,11 @@ case "$1" in
;;
start)
[ -z "$SECTION" ] && usage_err "command 'start': 'SECTION' not set"
- $DDNSPRG -v $VERBOSE -S $SECTION -- start
+ if [ $VERBOSE -eq 0 ]; then # start in background
+ $DDNSPRG -v 0 -S $SECTION -- start &
+ else
+ $DDNSPRG -v $VERBOSE -S $SECTION -- start
+ fi
;;
reload)
$DDNSPRG -- reload
diff --git a/net/ddns-scripts/files/dynamic_dns_updater.sh b/net/ddns-scripts/files/dynamic_dns_updater.sh
@@ -72,23 +72,25 @@ case "$1" in
start)
if [ -n "$NETWORK" ]; then
start_daemon_for_all_ddns_sections "$NETWORK"
- exit $?
+ exit 0
fi
if [ -z "$SECTION_ID" ]; then
start_daemon_for_all_ddns_sections
- exit $?
+ exit 0
fi
;;
stop)
if [ -n "$INTERFACE" ]; then
stop_daemon_for_all_ddns_sections "$NETWORK"
+ exit 0
else
- killall ddns-updater.sh 2>/dev/null
+ stop_daemon_for_all_ddns_sections
+ exit 0
fi
- exit $?
+ exit 1
;;
reload)
- killall -1 ddns-updater.sh 2>/dev/null
+ killall -1 dynamic_dns_updater.sh 2>/dev/null
exit $?
;;
*) usage_err "unknown command - $1";;