Subject: [PATCH] main/busybox: allow setting hostname dynamically

From: Tim Wiederhake <[email-masked]>
Date: Thu, 29 Oct 2020 22:54:28 +0100

---
 main/busybox/default.script | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/main/busybox/default.script b/main/busybox/default.script
index 2b787b1484..9b6495585a 100644
--- a/main/busybox/default.script
+++ b/main/busybox/default.script
@@ -90,6 +90,9 @@ resolvconf() {
 	for i in $NO_DNS; do
 		[ "$i" = "$interface" ] && return
 	done
+	if [ -n "$hostname" ] && [ "$(hostname)" = "localhost" ]; then
+		hostname $hostname
+	fi
 	echo -n > "$RESOLV_CONF.$$"
 	if [ -n "$search" ]; then
 		echo "search $search" >> "$RESOLV_CONF.$$"
--
2.28.0