1 |
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 |
2 |
--- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers 2005-11-20 23:28:06.000000000 -0500 |
3 |
+++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25DomainNameServers 2021-03-30 17:41:49.918000000 -0400 |
4 |
@@ -1 +1,16 @@ |
5 |
- option domain-name-servers { $LocalIP }; |
6 |
+{ |
7 |
+ my @dnsserv; |
8 |
+ my $dnscustom = $DB->get_prop('dhcpd', 'dnscustom') || 'disabled'; |
9 |
+ if ( $dnscustom eq 'enabled') { |
10 |
+ push @dnsserv,$DB->get_prop('dhcpd', 'dns1server') if $DB->get_prop('dhcpd', 'dns1server'); |
11 |
+ push @dnsserv,$DB->get_prop('dhcpd', 'dns2server') if $DB->get_prop('dhcpd', 'dns2server'); |
12 |
+ push @dnsserv,$DB->get_prop('dhcpd', 'dns3server') if $DB->get_prop('dhcpd', 'dns3server'); |
13 |
+ } |
14 |
+ # force our own dhcp server unless there is already 2 or more |
15 |
+ push @dnsserv,$LocalIP unless ( scalar(@dnsserv) >=2) ; |
16 |
+ # remove duplicates, so you can put twice the same to avoid our own dhcp server |
17 |
+ # most clients support up to 3 dns server or ignore the third one |
18 |
+ @dnsserv= do { my %seen; grep { !$seen{$_}++ } @dnsserv}; |
19 |
+ |
20 |
+ $OUT = " option domain-name-servers ". join(",", @dnsserv); |
21 |
+} |
22 |
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 |
23 |
--- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault 2005-11-20 23:28:06.000000000 -0500 |
24 |
+++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault 2021-03-30 17:41:50.167000000 -0400 |
25 |
@@ -1 +1 @@ |
26 |
- default-lease-time { 86400 }; |
27 |
+ default-lease-time { $DB->get_prop('dhcpd', 'leasetime') || 86400 }; |
28 |
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 |
29 |
--- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax 2005-11-20 23:28:06.000000000 -0500 |
30 |
+++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax 2021-03-30 17:41:50.401000000 -0400 |
31 |
@@ -1 +1 @@ |
32 |
- max-lease-time { 7*86400 }; |
33 |
+ max-lease-time { 7*($DB->get_prop('dhcpd', 'leasetime') || 86400) }; |
34 |
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 |
35 |
--- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers 2005-11-20 23:28:06.000000000 -0500 |
36 |
+++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/dhcpd.conf/25Routers 2021-03-30 17:48:47.065000000 -0400 |
37 |
@@ -1,11 +1,21 @@ |
38 |
-{ |
39 |
- my $router = (defined $SystemMode && $SystemMode =~ /servergateway/) |
40 |
- ? $LocalIP : |
41 |
- defined $GatewayIP ? $GatewayIP : undef; |
42 |
+{ |
43 |
|
44 |
- $OUT = ""; |
45 |
- if ($router) |
46 |
- { |
47 |
- $OUT .= " option routers $router;"; |
48 |
- } |
49 |
+ my $dhcpgatewaycustom = $DB->get_prop('dhcpd', 'gatewaycustom'); |
50 |
+ my $dhcpgateway= $DB->get_prop('dhcpd', 'gateway')||'disabled'; |
51 |
+ if ($dhcpgatewaycustom eq 'enabled') |
52 |
+ { |
53 |
+ $OUT .= " option routers $dhcpgateway;"; |
54 |
+ } |
55 |
+ else |
56 |
+ { |
57 |
+ my $router = (defined $SystemMode && $SystemMode =~ /servergateway/) |
58 |
+ ? $LocalIP : |
59 |
+ defined $GatewayIP ? $GatewayIP : undef; |
60 |
+ |
61 |
+ $OUT = ""; |
62 |
+ if ($router) |
63 |
+ { |
64 |
+ $OUT .= " option routers $router;"; |
65 |
+ } |
66 |
+ } |
67 |
} |