isc-dhcp: allow explicitly configuring a domain
authorPhilip Prindeville <philipp@redfish-solutions.com>
Sun, 25 Mar 2018 07:49:13 +0000 (01:49 -0600)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Fri, 30 Mar 2018 02:12:03 +0000 (20:12 -0600)
Setting a domain now results in 'option domain-name "xyzzy";'
being generated globally.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/isc-dhcp/files/dhcpd.init

index e853ffe0a1af76592feb37d1d3bd25d693abb78f..453adfa81076baa35e3c1cd749751b1b09577ef8 100644 (file)
@@ -206,6 +206,8 @@ general_config() {
        config_get max_lease_time "isc_dhcpd" "max_lease_time" 86400
        config_get log_facility "isc_dhcpd" "log_facility"
 
+       config_get domain "isc_dhcpd" "domain"
+
        [ $always_broadcast -eq 1 ] && echo "always-broadcast true;"
        [ $authoritative -eq 1 ] && echo "authoritative;"
        [ $boot_unknown_clients -eq 0 ] && echo "boot-unknown-clients false;"
@@ -220,6 +222,8 @@ general_config() {
        fi
        echo "default-lease-time $default_lease_time;"
        echo "max-lease-time $max_lease_time;"
+
+       [ -n "$domain" ] && echo "option domain-name \"$domain\";"
 }
 
 start_service() {
@@ -231,7 +235,7 @@ start_service() {
                touch $lease_file
        fi
 
-       dhcp_ifs=""
+       local domain dhcp_ifs
 
        if [ -e "/etc/dhcpd.conf" ] ; then
                config_file="/etc/dhcpd.conf"