Skip to content

Commit

Permalink
ddns-scripts: allow for commands in $ip_script
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Nachtigall <[email protected]>
  • Loading branch information
jenszo committed Sep 29, 2024
1 parent 179bf9d commit 738a39c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net/ddns-scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ddns-scripts
PKG_VERSION:=2.8.2
PKG_RELEASE:=48
PKG_RELEASE:=49

PKG_LICENSE:=GPL-2.0

Expand Down
5 changes: 3 additions & 2 deletions net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ trap "trap_handler 15" 15 # SIGTERM Termination
# ip_source source to detect current IP ('network' or 'web' or 'script' or 'interface')
# ip_network local defined network to read IP from i.e. 'wan' or 'wan6'
# ip_url URL to read current IP from i.e. http://checkip.dyndns.com/ or http://checkipv6.dyndns.com/
# ip_script full path and name of your script to detect current IP
# ip_script either full path and name of your script or single (Ash-compatible) statement to detect current IP
# ip_interface physical interface to use for detecting
#
# check_interval check for changes every !!! checks below 10 minutes make no sense because the Internet
Expand Down Expand Up @@ -282,7 +282,8 @@ esac
if [ "$ip_source" = "script" ]; then
set -- $ip_script #handling script with parameters, we need a trick
[ -z "$1" ] && write_log 14 "No script defined to detect current IP!"
[ -x "$1" ] || write_log 14 "Script to detect current IP not executable!"
[ -f "$1" -a ! -x "$1" ] && write_log 14 "Script to detect current IP not executable!"
[ ! -f "$1" ] && ( command -v "$1" > /dev/null 2>&1 || write_log 14 "Script to detect current IP: File or command not found!" )
fi

# compute update interval in seconds
Expand Down

0 comments on commit 738a39c

Please sign in to comment.