dhcp: allow custom configuration from directories; closes #5313

This commit is contained in:
Franco Fichtner 2022-04-08 14:22:22 +02:00
parent 1b7ab40ce4
commit 4485895274
4 changed files with 12 additions and 0 deletions

2
plist
View File

@ -6,6 +6,8 @@
/usr/local/etc/dh-parameters.2048.rfc7919
/usr/local/etc/dh-parameters.3072.rfc7919
/usr/local/etc/dh-parameters.4096.rfc7919
/usr/local/etc/dhcpd.opnsense.d/README
/usr/local/etc/dhcpd6.opnsense.d/README
/usr/local/etc/dnsmasq.conf.d/README
/usr/local/etc/inc/IPv6.inc
/usr/local/etc/inc/XMLRPC_Client.inc

View File

@ -0,0 +1 @@
OPNsense: automatically included dhcpd.conf files for IPv4.

View File

@ -0,0 +1 @@
OPNsense: automatically included dhcpd.conf files for IPv6.

View File

@ -1251,6 +1251,10 @@ EOD;
$dhcpdconf .= dhcpd_zones($ddns_zones);
}
foreach (glob('/usr/local/etc/dhcpd.opnsense.d/*.conf') as $file) {
$dhcpdconf .= "\n\n# including custom file {$file}\n" . file_get_contents($file);
}
@file_put_contents('/var/dhcpd/etc/dhcpd.conf', $dhcpdconf);
@touch('/var/dhcpd/var/db/dhcpd.leases');
@unlink('/var/dhcpd/var/run/dhcpd.pid');
@ -1672,6 +1676,10 @@ EOD;
$dhcpdv6conf .= "\nddns-update-style none;\n";
}
foreach (glob('/usr/local/etc/dhcpd6.opnsense.d/*.conf') as $file) {
$dhcpdv6conf .= "\n\n# including custom file {$file}\n" . file_get_contents($file);
}
@file_put_contents('/var/dhcpd/etc/dhcpdv6.conf', $dhcpdv6conf);
@touch('/var/dhcpd/var/db/dhcpd6.leases');
@unlink('/var/dhcpd/var/run/dhcpdv6.pid');