Release new version 1:20210208+grml.5
[live-boot-grml.git] / components / 9990-networking.sh
index cfafcb0..92c66ee 100755 (executable)
@@ -133,6 +133,12 @@ do_netsetup ()
                        HWADDR="$(cat "/sys/class/net/${interface}/address")"
                fi
 
+               if [ ! -e "/etc/hostname" ] && [ -n "${HOSTNAME}" ]
+               then
+                       echo "Creating /etc/hostname"
+                       echo "${HOSTNAME}" > /etc/hostname
+               fi
+
                # Only create /etc/hosts if FQDN is known (to let 'hostname -f' query
                # this file). Otherwise DNS will be queried to determine the FQDN.
                if [ ! -e "/etc/hosts" ] && [ -n "${DNSDOMAIN}" ]