Merge pull request #3622 from chris5560/master
ddns-scripts: various fixes
This commit is contained in:
commit
2c4e5df48a
5 changed files with 24 additions and 14 deletions
|
@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
|
||||||
PKG_VERSION:=2.7.6
|
PKG_VERSION:=2.7.6
|
||||||
# Release == build
|
# Release == build
|
||||||
# increase on changes of services files or tld_names.dat
|
# increase on changes of services files or tld_names.dat
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
|
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
# Please read http://wiki.openwrt.org/doc/uci/ddns
|
# Please read http://wiki.openwrt.org/doc/uci/ddns
|
||||||
#
|
#
|
||||||
config ddns "global"
|
config ddns "global"
|
||||||
option date_format "%F %R"
|
option ddns_dateformat "%F %R"
|
||||||
# option run_dir "/var/run/ddns"
|
# option ddns_rundir "/var/run/ddns"
|
||||||
# option log_dir "/var/log/ddns"
|
# option ddns_logdir "/var/log/ddns"
|
||||||
option log_lines "250"
|
option ddns_loglines "250"
|
||||||
option allow_local_ip "0"
|
option upd_privateip "0"
|
||||||
|
|
||||||
|
|
||||||
config service "myddns_ipv4"
|
config service "myddns_ipv4"
|
||||||
|
|
|
@ -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,\}\)"
|
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)
|
# 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
|
# Name Server Lookup Programs
|
||||||
BIND_HOST=$(which host)
|
BIND_HOST=$(which host)
|
||||||
|
@ -181,7 +181,11 @@ start_daemon_for_all_ddns_sections()
|
||||||
for __SECTIONID in $__SECTIONS; do
|
for __SECTIONID in $__SECTIONS; do
|
||||||
config_get __IFACE "$__SECTIONID" interface "wan"
|
config_get __IFACE "$__SECTIONID" interface "wan"
|
||||||
[ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
|
[ -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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,11 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
[ -z "$SECTION" ] && usage_err "command 'start': 'SECTION' not set"
|
[ -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)
|
reload)
|
||||||
$DDNSPRG -- reload
|
$DDNSPRG -- reload
|
||||||
|
|
|
@ -72,23 +72,25 @@ case "$1" in
|
||||||
start)
|
start)
|
||||||
if [ -n "$NETWORK" ]; then
|
if [ -n "$NETWORK" ]; then
|
||||||
start_daemon_for_all_ddns_sections "$NETWORK"
|
start_daemon_for_all_ddns_sections "$NETWORK"
|
||||||
exit $?
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [ -z "$SECTION_ID" ]; then
|
if [ -z "$SECTION_ID" ]; then
|
||||||
start_daemon_for_all_ddns_sections
|
start_daemon_for_all_ddns_sections
|
||||||
exit $?
|
exit 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
if [ -n "$INTERFACE" ]; then
|
if [ -n "$INTERFACE" ]; then
|
||||||
stop_daemon_for_all_ddns_sections "$NETWORK"
|
stop_daemon_for_all_ddns_sections "$NETWORK"
|
||||||
|
exit 0
|
||||||
else
|
else
|
||||||
killall ddns-updater.sh 2>/dev/null
|
stop_daemon_for_all_ddns_sections
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
exit $?
|
exit 1
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
killall -1 ddns-updater.sh 2>/dev/null
|
killall -1 dynamic_dns_updater.sh 2>/dev/null
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
*) usage_err "unknown command - $1";;
|
*) usage_err "unknown command - $1";;
|
||||||
|
|
Loading…
Reference in a new issue