summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/udhcpc-trigger.stage320
1 files changed, 10 insertions, 10 deletions
diff --git a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3 b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
index ee870873..d54939a8 100755
--- a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
+++ b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
@@ -105,19 +105,19 @@ if [ -n "$ntpsrv" ]; then
fi
# Hostname
-# Ignore it if hostname was forced per KCL
+# Ignore hostname/fqdn it if hostname was forced per KCL.
if [ -n "$SLX_PXE_HOSTNAME" ]; then
echo "Hostname set via KCL, ignoring DHCP hostname: '$hostname'"
hostname="$SLX_PXE_HOSTNAME"
-fi
-
-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" ] && fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
- hostname="${fqdn%%.*}"
-elif [ -n "$domain" ]; then
- fqdn="${hostname}.${domain%% *}" # in case domain is a list
+else
+ 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" ] && fqdn=$(timeout -t 3 nslookup "$ip" | grep -E "^Address +[0-9]+: +$ip " | head -n 1 | awk '{print $4}')
+ hostname="${fqdn%%.*}"
+ elif [ -n "$domain" ]; then
+ fqdn="${hostname}.${domain%% *}" # in case domain is a list
+ fi
fi
if [ -z "$hostname" ]; then