mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
ddns-scripts: fix getting IP address via web in get_current_ip()
Add back the regex searching for valid IP address when getting IP
address via web.
Fixes: 9cdd1a1660 ("ddns-scripts: refactor get_current_ip()")
Signed-off-by: Qian Suyao <qiansuyao@gmail.com>
This commit is contained in:
committed by
Florian Eckert
parent
ac1076ef95
commit
65a9d7d450
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts
|
||||
PKG_VERSION:=2.8.2
|
||||
PKG_RELEASE:=76
|
||||
PKG_RELEASE:=77
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
||||
@@ -936,7 +936,8 @@ get_current_ip () {
|
||||
[ -z "$ip_url" ] && { write_log 12 "get_current_ip: 'ip_url' not set for source 'web'"; return 2; }
|
||||
do_transfer "$ip_url"
|
||||
# bug: do_transfer does not output to DATFILE
|
||||
read -r data < "$DATFILE"
|
||||
[ $use_ipv6 -eq 0 ] && data=$(grep -m 1 -o "$IPV4_REGEX" "$DATFILE")
|
||||
[ $use_ipv6 -eq 1 ] && data=$(grep -m 1 -o "$IPV6_REGEX" "$DATFILE")
|
||||
[ -n "$data" ] && write_log 7 "Current IP '$data' detected via web at '$ip_url'"
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user