SlugOS: sysconf - pass along hostname to DHCP server
authorMike Westerhof <mwester@dls.net>
Sun, 30 Jan 2011 13:43:55 +0000 (07:43 -0600)
committerMike Westerhof <mwester@dls.net>
Sun, 30 Jan 2011 13:43:55 +0000 (07:43 -0600)
This change will result in the appropriate DNS entry being created
dynamically, if the DHCP server supports doing so.
Signed-off-by: Mike Westerhof <mike@mwester.net>
recipes/slugos-init/files/sysconf

index 8d59d5d..41aa785 100644 (file)
@@ -182,6 +182,8 @@ sysconf_reload(){
                echo "# address, netmask and gateway are ignored for 'dhcp'"
                echo "# but required for 'static'"
                echo "iface $iface inet $boot"
+               # The following is used by DHCP to register the hostname
+               test -n "$host"    && echo "    hostname $host"
                # The following are ignored for DHCP but are harmless
                test -n "$ip"      && echo "    address $ip"
                test -n "$netmask" && echo "    netmask $netmask"