diff options
author | Simon Rettberg | 2024-03-01 14:58:31 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-03-01 14:58:31 +0100 |
commit | 5f507f54faec0c14a8e99024026c2e3653f0f8de (patch) | |
tree | 01bf34447fa6cf76cb3cd37c3d87baee33e91f88 | |
parent | [slx-network] Overhaul DHCP trigger, generation of resolv.conf, hosts (diff) | |
download | systemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.tar.gz systemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.tar.xz systemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.zip |
[slx-network] Fix escaping in awk script
-rwxr-xr-x | modules.d/slx-network/scripts/udhcpc-trigger.stage3 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules.d/slx-network/scripts/udhcpc-trigger.stage3 b/modules.d/slx-network/scripts/udhcpc-trigger.stage3 index fa771868..a9eadea3 100755 --- a/modules.d/slx-network/scripts/udhcpc-trigger.stage3 +++ b/modules.d/slx-network/scripts/udhcpc-trigger.stage3 @@ -71,9 +71,9 @@ reverse_lookup() { [ -z "$dns" ] && return [ -z "$1" ] && return timeout 3 nslookup "$1" | awk '{ - if ($2 == "name") { print gensub("\.$", "", "", $4); exit; } + if ($2 == "name") { print gensub("\\.$", "", 1, $4); exit; } if ($1 == "Name:") { ok = 1 } - if (ok && $1 == "Address") { print gensub("\.$", "", "", $4); exit; } + if (ok && $1 == "Address") { print gensub("\\.$", "", 1, $4); exit; } }' } |