Browse Source

ddns-scripts: various fixes

fixes reported in #3621 #3617 #3616

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
lilik-openwrt-22.03
Christian Schoenebeck 8 years ago
parent
commit
4ae1484a19
5 changed files with 24 additions and 14 deletions
  1. +1
    -1
      net/ddns-scripts/Makefile
  2. +5
    -5
      net/ddns-scripts/files/ddns.config
  3. +6
    -2
      net/ddns-scripts/files/dynamic_dns_functions.sh
  4. +5
    -1
      net/ddns-scripts/files/dynamic_dns_lucihelper.sh
  5. +7
    -5
      net/ddns-scripts/files/dynamic_dns_updater.sh

+ 1
- 1
net/ddns-scripts/Makefile View File

@ -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>


+ 5
- 5
net/ddns-scripts/files/ddns.config View 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"


+ 6
- 2
net/ddns-scripts/files/dynamic_dns_functions.sh View File

@ -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
}


+ 5
- 1
net/ddns-scripts/files/dynamic_dns_lucihelper.sh View File

@ -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


+ 7
- 5
net/ddns-scripts/files/dynamic_dns_updater.sh View File

@ -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";;


Loading…
Cancel
Save