summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-03-01 14:58:31 +0100
committerSimon Rettberg2024-03-01 14:58:31 +0100
commit5f507f54faec0c14a8e99024026c2e3653f0f8de (patch)
tree01bf34447fa6cf76cb3cd37c3d87baee33e91f88
parent[slx-network] Overhaul DHCP trigger, generation of resolv.conf, hosts (diff)
downloadsystemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.tar.gz
systemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.tar.xz
systemd-init-5f507f54faec0c14a8e99024026c2e3653f0f8de.zip
[slx-network] Fix escaping in awk script
-rwxr-xr-xmodules.d/slx-network/scripts/udhcpc-trigger.stage34
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; }
}'
}