summaryrefslogtreecommitdiffstats
path: root/core/rootfs
diff options
context:
space:
mode:
authorSimon Rettberg2020-08-03 18:01:56 +0200
committerYour Name2020-08-03 18:01:56 +0200
commit3f70bd05d0fc22d417b73c2a8767b15bf9622bec (patch)
treee4bf4fa02f48b6c0c18cf831622fe6aea5e6e3fe /core/rootfs
parent[vmware12] add libncursesw5 required for console isntall (diff)
downloadmltk-3f70bd05d0fc22d417b73c2a8767b15bf9622bec.tar.gz
mltk-3f70bd05d0fc22d417b73c2a8767b15bf9622bec.tar.xz
mltk-3f70bd05d0fc22d417b73c2a8767b15bf9622bec.zip
[rfs-stage31] Fix hostname lookup for newer busybox nslookup
Diffstat (limited to 'core/rootfs')
-rwxr-xr-xcore/rootfs/rootfs-stage31/data/inc/udhcpc-trigger4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/udhcpc-trigger b/core/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
index cc7454e7..5ec15a74 100755
--- a/core/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
+++ b/core/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
@@ -73,7 +73,7 @@ done
if [ -z "$domain" ] && [ -n "$dns" ]; then
# try to get domain via reverse lookup if empty
echo "..trying to get domain via DNS, as DHCP didn't supply one.."
- fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
+ fqdn=$(timeout -t 3 nslookup "$ip" | awk '{if ($2 == "name") { print $4; exit; } }')
domain="${fqdn#*.}"
fi
# Add domain to list of search domains if not in there yet
@@ -106,7 +106,7 @@ done
if [ -z "$hostname" ]; then
# as with domain, if there's no hostname, try to get via DNS
echo "..trying to get hostname via DNS, as DHCP didn't supply one.."
- [ -z "$fqdn" ] && [ -n "$dns" ] && fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
+ [ -z "$fqdn" ] && [ -n "$dns" ] && fqdn=$(timeout -t 3 nslookup "$ip" | awk '{if ($2 == "name") { print $4; exit; } }')
hostname="${fqdn%%.*}"
elif [ -n "$domain" ]; then
fqdn="${hostname}.${domain}"