From c47c648f394c17bff042ceaa9dede90f1742f110 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Aug 2020 11:39:25 +0200 Subject: [dhcpc-busybox] Re-set hostname if it's noname-* stage31 would set the hostname to noname-IP if we skipped DHCP and reverse DNS didn't supply one. In that case consider honoring the hostname from DHCP again. --- core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/modules/dhcpc-busybox') diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx index debe82a4..8130eb13 100755 --- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx +++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx @@ -88,7 +88,7 @@ case "$1" in fi # get domain, hostname and thus fqdn from DNS - dns_fqdn=$(busybox timeout -t 3 rdns "$ip") + dns_fqdn=$(busybox timeout 3 rdns "$ip") dns_short="${dns_fqdn%%.*}" # check if it is fqdn if [ "$dns_fqdn" == "$dns_short" ]; then @@ -165,7 +165,7 @@ case "$1" in fi # Only if network is not ready yet - if [ ! -e "/run/network/network-ready" ]; then + if ! [ -e "/run/network/network-ready" ] || ! [ -e "/etc/hostname" ] || grep -q '^noname-' "/etc/hostname"; then # Update hostname if [ -z "$dns_fqdn" ] && [ -n "$domain" ] && [ -n "$hostname" ]; then # fallback to what the dhcp told us -- cgit v1.2.3-55-g7522