diff options
-rwxr-xr-x | modules.d/slx-network/scripts/udhcpc-trigger.stage3 | 6 |
1 files changed, 5 insertions, 1 deletions
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" |