mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
dhcp: reload action for cron; closes #5410
Change the structure a little to support reloading either all dhcp-related services or only a certain address family through optional parameter: "inet" for IPv4 and "inet6" for IPv6. The issue with the original proposal was that although dhcpd6 was restarted we also need to restart radvd since it is affected by the same bug #4691 and still seems to be happening in the wild in FreeBSD 13. While here expand to full path of pluginctl in an unrelated file.
This commit is contained in:
parent
8ea40560df
commit
80ba04f721
@ -575,7 +575,7 @@ function dhcpd_radvd_configure($verbose = false, $blacklist = array())
|
||||
}
|
||||
}
|
||||
|
||||
function dhcpd_dhcp_configure($verbose = false, $family = 'all', $blacklist = array())
|
||||
function dhcpd_dhcp_configure($verbose = false, $family = null, $blacklist = [])
|
||||
{
|
||||
$dirs = array('/dev', '/etc', '/lib', '/run', '/usr', '/usr/local/sbin', '/var/db', '/var/run');
|
||||
|
||||
@ -589,11 +589,11 @@ function dhcpd_dhcp_configure($verbose = false, $family = 'all', $blacklist = ar
|
||||
|
||||
mwexecf('/usr/sbin/chown -R dhcpd:dhcpd %s', '/var/dhcpd');
|
||||
|
||||
if ($family == 'all' || $family == 'inet') {
|
||||
if ($family == null || $family == 'inet') {
|
||||
dhcpd_dhcp4_configure($verbose);
|
||||
}
|
||||
|
||||
if ($family == 'all' || $family == 'inet6') {
|
||||
if ($family == null || $family == 'inet6') {
|
||||
dhcpd_dhcp6_configure($verbose, $blacklist);
|
||||
dhcpd_radvd_configure($verbose, $blacklist);
|
||||
}
|
||||
@ -1682,13 +1682,13 @@ EOD;
|
||||
}
|
||||
}
|
||||
|
||||
function dhcpd_dhcrelay_configure($verbose = false, $family = 'all')
|
||||
function dhcpd_dhcrelay_configure($verbose = false, $family = null)
|
||||
{
|
||||
if ($family == 'all' || $family == 'inet') {
|
||||
if ($family == null || $family == 'inet') {
|
||||
dhcpd_dhcrelay4_configure($verbose);
|
||||
}
|
||||
|
||||
if ($family == 'all' || $family == 'inet6') {
|
||||
if ($family == null || $family == 'inet6') {
|
||||
dhcpd_dhcrelay6_configure($verbose);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[restart]
|
||||
command:pluginctl -s cron restart
|
||||
command:/usr/local/sbin/pluginctl -s cron restart
|
||||
parameters:
|
||||
type:script
|
||||
message:restarting cron
|
||||
|
||||
@ -9,3 +9,10 @@ command:/usr/local/opnsense/scripts/dhcp/prefixes.php
|
||||
parameters:
|
||||
type:script
|
||||
message:update IPv6 prefixes
|
||||
|
||||
[restart]
|
||||
command:/usr/local/sbin/pluginctl dhcp
|
||||
parameters:%s
|
||||
type:script
|
||||
message:restarting %s dhcpd
|
||||
description:Restart DHCPd
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user