summaryrefslogtreecommitdiffstats
path: root/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
diff options
context:
space:
mode:
authorSimon Rettberg2020-08-07 11:39:25 +0200
committerSimon Rettberg2020-08-07 11:39:25 +0200
commitc47c648f394c17bff042ceaa9dede90f1742f110 (patch)
treee832944253aad2a1a87b67fbf0a59d33c61c8e3d /core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
parent[kexec-reboot] Fix X/Y calc (follow 2d084c4826bb3d) (diff)
downloadmltk-c47c648f394c17bff042ceaa9dede90f1742f110.tar.gz
mltk-c47c648f394c17bff042ceaa9dede90f1742f110.tar.xz
mltk-c47c648f394c17bff042ceaa9dede90f1742f110.zip
[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.
Diffstat (limited to 'core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx4
1 files changed, 2 insertions, 2 deletions
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