diff options
author | Simon Rettberg | 2023-01-25 16:04:57 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-01-25 16:04:57 +0100 |
commit | e1b7ca91e14d93b4af0dedc4e425d2e1a6c5d16c (patch) | |
tree | 36bd0a55a34a03d9b4bbc2d482207c677ab68753 | |
parent | [busybox] Restore installer mode (diff) | |
download | systemd-init-e1b7ca91e14d93b4af0dedc4e425d2e1a6c5d16c.tar.gz systemd-init-e1b7ca91e14d93b4af0dedc4e425d2e1a6c5d16c.tar.xz systemd-init-e1b7ca91e14d93b4af0dedc4e425d2e1a6c5d16c.zip |
[slx-network] Adapt to new busybox nslookup output syntax
-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" |