mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
ddns-scripts: Update knot resolver regexp
The output format of `khost` has changed. This commit fixes the regexp
for IPv4. It fixes the issue of using a custom DNS to resolve current
address.
```bash
root@localhost:~# khost ns2.afraid.org
ns2.afraid.org. has IPv4 address 69.65.50.223
ns2.afraid.org. has IPv6 address 2001:1850:1:5:800::6b
Host ns2.afraid.org. has no MX record
root@localhost:~# khost --version
khost (Knot DNS), version 3.3.5
```
Signed-off-by: Denis Shulyaka <Shulyaka@gmail.com>
(cherry picked from commit ebeae334d9)
This commit is contained in:
committed by
Josef Schlehofer
parent
f2044c19c0
commit
dbac39060b
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=ddns-scripts
|
PKG_NAME:=ddns-scripts
|
||||||
PKG_VERSION:=2.8.2
|
PKG_VERSION:=2.8.2
|
||||||
PKG_RELEASE:=42
|
PKG_RELEASE:=43
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
|
|||||||
@@ -547,9 +547,12 @@ verify_host_port() {
|
|||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
# extract IP address
|
# extract IP address
|
||||||
if [ -n "$BIND_HOST" -o -n "$KNOT_HOST" ]; then # use BIND host or Knot host if installed
|
if [ -n "$BIND_HOST" ]; then # use BIND host if installed
|
||||||
__IPV4="$(awk -F "address " '/has address/ {print $2; exit}' "$DATFILE")"
|
__IPV4="$(awk -F "address " '/has address/ {print $2; exit}' "$DATFILE")"
|
||||||
__IPV6="$(awk -F "address " '/has IPv6/ {print $2; exit}' "$DATFILE")"
|
__IPV6="$(awk -F "address " '/has IPv6/ {print $2; exit}' "$DATFILE")"
|
||||||
|
elif [ -n "$KNOT_HOST" ]; then # use Knot host if installed
|
||||||
|
__IPV4="$(awk -F "address " '/has IPv4/ {print $2; exit}' "$DATFILE")"
|
||||||
|
__IPV6="$(awk -F "address " '/has IPv6/ {print $2; exit}' "$DATFILE")"
|
||||||
elif [ -n "$DRILL" ]; then # use drill if installed
|
elif [ -n "$DRILL" ]; then # use drill if installed
|
||||||
__IPV4="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV4_REGEX")"
|
__IPV4="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV4_REGEX")"
|
||||||
__IPV6="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV6_REGEX")"
|
__IPV6="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV6_REGEX")"
|
||||||
|
|||||||
Reference in New Issue
Block a user