diff --git a/src/etc/inc/plugins.inc.d/dhcpd.inc b/src/etc/inc/plugins.inc.d/dhcpd.inc index 159cb6885..19efbe387 100644 --- a/src/etc/inc/plugins.inc.d/dhcpd.inc +++ b/src/etc/inc/plugins.inc.d/dhcpd.inc @@ -32,9 +32,9 @@ function dhcpd_configure() { return array( - 'dhcp' => array('services_dhcpd_configure:3'), + 'dhcp' => array('dhcpd_dhcp_configure:3'), 'dhcrelay' => array('dhcpd_dhcrelay_configure:2'), - 'local' => array('services_dhcpd_configure', 'dhcpd_dhcrelay_configure'), + 'local' => array('dhcpd_dhcp_configure', 'dhcpd_dhcrelay_configure'), ); } @@ -503,8 +503,7 @@ function dhcpd_dhcpv6_leasesfile() return '/var/dhcpd/var/db/dhcpd6.leases'; } -/* XXX dhcpd_dhcp_configure() */ -function services_dhcpd_configure($verbose = false, $family = 'all', $blacklist = array()) +function dhcpd_dhcp_configure($verbose = false, $family = 'all', $blacklist = array()) { $dirs = array('/dev', '/etc', '/lib', '/run', '/usr', '/usr/local/sbin', '/var/db', '/var/run'); diff --git a/src/www/services_dhcp.php b/src/www/services_dhcp.php index 1b67c2f6d..2bea8275e 100644 --- a/src/www/services_dhcp.php +++ b/src/www/services_dhcp.php @@ -81,9 +81,6 @@ function validate_partial_mac_list($maclist) { return true; } -/** - * restart dhcp service - */ function reconfigure_dhcpd() { /* Stop DHCP so we can cleanup leases */ @@ -91,7 +88,7 @@ function reconfigure_dhcpd() dhcp_clean_leases(); system_hosts_generate(); clear_subsystem_dirty('hosts'); - services_dhcpd_configure(); + dhcpd_dhcp_configure(false, 'inet'); clear_subsystem_dirty('staticmaps'); } diff --git a/src/www/services_dhcpv6.php b/src/www/services_dhcpv6.php index bda356148..1054e2cbe 100644 --- a/src/www/services_dhcpv6.php +++ b/src/www/services_dhcpv6.php @@ -34,14 +34,11 @@ require_once("system.inc"); require_once("interfaces.inc"); require_once("services.inc"); -/** - * restart dhcp service - */ function reconfigure_dhcpd() { system_hosts_generate(); clear_subsystem_dirty('hosts'); - services_dhcpd_configure(); + dhcpd_dhcp_configure(false, 'inet6'); clear_subsystem_dirty('staticmaps'); } diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php index 0969011cb..0d8a51ff9 100644 --- a/src/www/services_dnsmasq.php +++ b/src/www/services_dnsmasq.php @@ -116,7 +116,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } write_config(); dnsmasq_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); header(url_safe('Location: /services_dnsmasq.php')); exit; } @@ -125,7 +125,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { system_resolvconf_generate(); system_hosts_generate(); dnsmasq_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); clear_subsystem_dirty('hosts'); header(url_safe('Location: /services_dnsmasq.php')); exit; diff --git a/src/www/services_dnsmasq_domainoverride_edit.php b/src/www/services_dnsmasq_domainoverride_edit.php index 128079a0f..1728b726d 100644 --- a/src/www/services_dnsmasq_domainoverride_edit.php +++ b/src/www/services_dnsmasq_domainoverride_edit.php @@ -113,7 +113,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $a_domainOverrides[] = $doment; } dnsmasq_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); write_config(); header(url_safe('Location: /services_dnsmasq.php')); exit; diff --git a/src/www/services_opendns.php b/src/www/services_opendns.php index ff88d077b..b2cc4fd77 100644 --- a/src/www/services_opendns.php +++ b/src/www/services_opendns.php @@ -1,35 +1,34 @@ - Copyright (c) 2008 Tellnet AG - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (c) 2015 Franco Fichtner + * Copyright (c) 2008 Tellnet AG + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ require_once("guiconfig.inc"); require_once("system.inc"); -require_once("services.inc"); require_once("interfaces.inc"); config_read_array('opendns'); @@ -101,7 +100,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } write_config('OpenDNS filter configuration change'); system_resolvconf_generate(); - services_dhcpd_configure(); + plugins_configure('dhcp'); $savemsg = get_std_save_message(); } } diff --git a/src/www/services_unbound.php b/src/www/services_unbound.php index 13e188758..e8d54ad3e 100644 --- a/src/www/services_unbound.php +++ b/src/www/services_unbound.php @@ -63,7 +63,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($pconfig['apply'])) { system_resolvconf_generate(); unbound_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); clear_subsystem_dirty('unbound'); header(url_safe('Location: /services_unbound.php')); exit; diff --git a/src/www/services_unbound_acls.php b/src/www/services_unbound_acls.php index 5a904dd19..9aa9136af 100644 --- a/src/www/services_unbound_acls.php +++ b/src/www/services_unbound_acls.php @@ -63,7 +63,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($pconfig['apply'])) { unbound_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); clear_subsystem_dirty('unbound'); header(url_safe('Location: /services_unbound_acls.php')); exit; diff --git a/src/www/services_unbound_advanced.php b/src/www/services_unbound_advanced.php index 194e95e63..6195b7fc9 100644 --- a/src/www/services_unbound_advanced.php +++ b/src/www/services_unbound_advanced.php @@ -78,7 +78,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($_POST['apply'])) { unbound_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); clear_subsystem_dirty('unbound'); header(url_safe('Location: /services_unbound_advanced.php')); exit; diff --git a/src/www/services_unbound_overrides.php b/src/www/services_unbound_overrides.php index 09e722120..03c9adb30 100644 --- a/src/www/services_unbound_overrides.php +++ b/src/www/services_unbound_overrides.php @@ -49,7 +49,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($pconfig['apply'])) { system_resolvconf_generate(); unbound_configure_do(); - services_dhcpd_configure(); + plugins_configure('dhcp'); clear_subsystem_dirty('unbound'); header(url_safe('Location: /services_unbound_overrides.php')); exit; diff --git a/src/www/status_dhcp_leases.php b/src/www/status_dhcp_leases.php index 7178235fa..7ef92daef 100644 --- a/src/www/status_dhcp_leases.php +++ b/src/www/status_dhcp_leases.php @@ -286,8 +286,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { fclose($fout); @unlink($leasesfile); @rename($leasesfile.".new", $leasesfile); - /* Restart DHCP Service */ - services_dhcpd_configure(); + + dhcpd_dhcp_configure(false, 'inet'); } } exit; diff --git a/src/www/status_dhcpv6_leases.php b/src/www/status_dhcpv6_leases.php index 61136e7c6..12936cdf3 100644 --- a/src/www/status_dhcpv6_leases.php +++ b/src/www/status_dhcpv6_leases.php @@ -356,8 +356,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { fclose($fout); @unlink($leasesfile); @rename($leasesfile.".new", $leasesfile); - /* Restart DHCP Service */ - services_dhcpd_configure(); + + dhcpd_dhcp_configure(false, 'inet6'); } } exit;