ddns-scripts: various fixes
authorChristian Schoenebeck <redacted>
Mon, 5 Dec 2016 19:40:09 +0000 (20:40 +0100)
committerChristian Schoenebeck <redacted>
Mon, 5 Dec 2016 19:40:09 +0000 (20:40 +0100)
fixes reported in #3621 #3617 #3616

Signed-off-by: Christian Schoenebeck <redacted>
net/ddns-scripts/Makefile
net/ddns-scripts/files/ddns.config
net/ddns-scripts/files/dynamic_dns_functions.sh
net/ddns-scripts/files/dynamic_dns_lucihelper.sh
net/ddns-scripts/files/dynamic_dns_updater.sh

index c2dc500c98a7b1fe916ae2f0496d1fb73d4fd407..5f6b84621a692a0bf3e6498a2c0f2b6cf2d0c243 100755 (executable)
@@ -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>
index 8ba3da58641c02a7c2cc0d0c3f795c6b10a9d5ed..6d6b810921626b00974d4a79b94d47233198117a 100644 (file)
@@ -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"
index 9a74d3149d0f3f82940892e3b46bdc7da1e7e058..8d648512869e32410a1c300ca71d99b830f94529 100755 (executable)
@@ -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
 }
 
index fd4bd2e8350f3b8105244bb94de65d02d06ab32d..b2831e6a214687798c3f1a54eafc514bf1d3911d 100755 (executable)
@@ -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
index 973ec8c02118f1124015c8c5253fa7cef0afaf73..c58be2ea38ef33bf8f5f9670897d5bb4c4b434c5 100755 (executable)
@@ -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";;
git clone https://git.99rst.org/PROJECT