diff -Nur --no-dereference e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers 2005-11-20 23:28:06.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers 2021-03-30 17:41:49.918000000 -0400 @@ -1 +1,16 @@ - option domain-name-servers { $LocalIP }; +{ + my @dnsserv; + my $dnscustom = $DB->get_prop('dhcpd', 'dnscustom') || 'disabled'; + if ( $dnscustom eq 'enabled') { + push @dnsserv,$DB->get_prop('dhcpd', 'dns1server') if $DB->get_prop('dhcpd', 'dns1server'); + push @dnsserv,$DB->get_prop('dhcpd', 'dns2server') if $DB->get_prop('dhcpd', 'dns2server'); + push @dnsserv,$DB->get_prop('dhcpd', 'dns3server') if $DB->get_prop('dhcpd', 'dns3server'); + } + # force our own dhcp server unless there is already 2 or more + push @dnsserv,$LocalIP unless ( scalar(@dnsserv) >=2) ; + # remove duplicates, so you can put twice the same to avoid our own dhcp server + # most clients support up to 3 dns server or ignore the third one + @dnsserv= do { my %seen; grep { !$seen{$_}++ } @dnsserv}; + + $OUT = " option domain-name-servers ". join(",", @dnsserv) .";"; +} diff -Nur --no-dereference e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault 2005-11-20 23:28:06.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault 2021-03-30 17:41:50.167000000 -0400 @@ -1 +1 @@ - default-lease-time { 86400 }; + default-lease-time { $DB->get_prop('dhcpd', 'leasetime') || 86400 }; diff -Nur --no-dereference e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax 2005-11-20 23:28:06.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax 2021-03-30 17:41:50.401000000 -0400 @@ -1 +1 @@ - max-lease-time { 7*86400 }; + max-lease-time { 7*($DB->get_prop('dhcpd', 'leasetime') || 86400) }; diff -Nur --no-dereference e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers 2005-11-20 23:28:06.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers 2021-03-30 17:48:47.065000000 -0400 @@ -1,11 +1,21 @@ -{ - my $router = (defined $SystemMode && $SystemMode =~ /servergateway/) - ? $LocalIP : - defined $GatewayIP ? $GatewayIP : undef; +{ - $OUT = ""; - if ($router) - { - $OUT .= " option routers $router;"; - } + my $dhcpgatewaycustom = $DB->get_prop('dhcpd', 'gatewaycustom'); + my $dhcpgateway= $DB->get_prop('dhcpd', 'gateway')||'disabled'; + if ($dhcpgatewaycustom eq 'enabled') + { + $OUT .= " option routers $dhcpgateway;"; + } + else + { + my $router = (defined $SystemMode && $SystemMode =~ /servergateway/) + ? $LocalIP : + defined $GatewayIP ? $GatewayIP : undef; + + $OUT = ""; + if ($router) + { + $OUT .= " option routers $router;"; + } + } }