From e1b7ca91e14d93b4af0dedc4e425d2e1a6c5d16c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 25 Jan 2023 16:04:57 +0100 Subject: [slx-network] Adapt to new busybox nslookup output syntax --- modules.d/slx-network/scripts/udhcpc-trigger.stage3 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules.d/slx-network/scripts/udhcpc-trigger.stage3 b/modules.d/slx-network/scripts/udhcpc-trigger.stage3 index 3c3d09ba..6b5bbdfa 100755 --- a/modules.d/slx-network/scripts/udhcpc-trigger.stage3 +++ b/modules.d/slx-network/scripts/udhcpc-trigger.stage3 @@ -66,7 +66,11 @@ rm -f -- "/etc/resolv.conf" reverse_lookup() { [ -z "$dns" ] && return [ -z "$1" ] && return - timeout 3 nslookup "$1" | awk '{if ($2 == "name") { print $4; exit; } }' + timeout 3 nslookup "$1" | awk '{ + if ($2 == "name") { print $4; exit; } + if ($1 == "Name:") { ok = 1 } + if (ok && $1 == "Address") { print $4; exit; } + }' } echo "# From DHCP in stage 3.1" >> "$NETWORK_CONF" -- cgit v1.2.3-55-g7522