mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
dhcprelay: port to #1256
This commit is contained in:
parent
b0ad4456ba
commit
203732a96b
@ -1418,24 +1418,23 @@ EOD;
|
||||
}
|
||||
}
|
||||
|
||||
function services_dhcrelay_configure()
|
||||
function services_dhcrelay_configure($verbose = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$dhcrelayifs = array();
|
||||
|
||||
/* kill any running dhcrelay */
|
||||
killbypid('/var/run/dhcrelay.pid');
|
||||
killbypid('/var/run/dhcrelay.pid', 'TERM', true);
|
||||
|
||||
$dhcrelaycfg =& $config['dhcrelay'];
|
||||
$dhcrelaycfg = &$config['dhcrelay'];
|
||||
|
||||
/* DHCPRelay enabled on any interfaces? */
|
||||
if (!isset($dhcrelaycfg['enable']))
|
||||
return 0;
|
||||
if (!isset($dhcrelaycfg['enable'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_exists("/var/run/booting")) {
|
||||
echo gettext("Starting DHCP relay service...");
|
||||
} else {
|
||||
sleep(1);
|
||||
if ($verbose) {
|
||||
echo 'Starting DHCP Relay...';
|
||||
flush();
|
||||
}
|
||||
|
||||
$iflist = get_configured_interface_list();
|
||||
@ -1524,7 +1523,7 @@ function services_dhcrelay_configure()
|
||||
/* fire up dhcrelay */
|
||||
if (empty($dhcrelayifs)) {
|
||||
log_error("No suitable interface found for running dhcrelay!");
|
||||
return; /* XXX */
|
||||
return;
|
||||
}
|
||||
|
||||
$cmd = "/usr/local/sbin/dhcrelay -i " . implode(" -i ", $dhcrelayifs);
|
||||
@ -1537,28 +1536,28 @@ function services_dhcrelay_configure()
|
||||
mwexec($cmd);
|
||||
unset($cmd);
|
||||
|
||||
return 0;
|
||||
if ($verbose) {
|
||||
echo "done\n";
|
||||
}
|
||||
}
|
||||
|
||||
function services_dhcrelay6_configure()
|
||||
function services_dhcrelay6_configure($verbose = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$dhcrelayifs = array();
|
||||
|
||||
/* kill any running dhcrelay */
|
||||
killbypid('/var/run/dhcrelay6.pid');
|
||||
killbypid('/var/run/dhcrelay6.pid', 'TERM', true);
|
||||
|
||||
$dhcrelaycfg =& $config['dhcrelay6'];
|
||||
$dhcrelaycfg = &$config['dhcrelay6'];
|
||||
|
||||
/* DHCPv6 Relay enabled on any interfaces? */
|
||||
if (!isset($dhcrelaycfg['enable'])) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_exists("/var/run/booting")) {
|
||||
echo gettext("Starting DHCPv6 relay service...");
|
||||
} else {
|
||||
sleep(1);
|
||||
if ($verbose) {
|
||||
echo 'Starting DHCPv6 Relay...';
|
||||
flush();
|
||||
}
|
||||
|
||||
$iflist = get_configured_interface_list();
|
||||
@ -1643,7 +1642,7 @@ function services_dhcrelay6_configure()
|
||||
/* fire up dhcrelay */
|
||||
if (empty($dhcrelayifs) || empty($srvifaces) ) {
|
||||
log_error("No suitable interface found for running dhcrelay -6!");
|
||||
return; /* XXX */
|
||||
return;
|
||||
}
|
||||
|
||||
$cmd = '/usr/local/sbin/dhcrelay -6 -pf /var/run/dhcrelay6.pid';
|
||||
@ -1656,7 +1655,9 @@ function services_dhcrelay6_configure()
|
||||
mwexec($cmd);
|
||||
unset($cmd);
|
||||
|
||||
return 0;
|
||||
if ($verbose) {
|
||||
echo "done\n";
|
||||
}
|
||||
}
|
||||
|
||||
function services_dyndns_list()
|
||||
|
||||
@ -196,17 +196,10 @@ echo "Starting NTP time client...";
|
||||
system_ntp_configure(false);
|
||||
echo "done.\n";
|
||||
|
||||
/* start DHCP service */
|
||||
services_dhcpd_configure();
|
||||
|
||||
/* start dhcpleases dhpcp hosts leases program */
|
||||
services_dhcpleases_configure();
|
||||
|
||||
/* start DHCP relay */
|
||||
services_dhcrelay_configure();
|
||||
|
||||
/* start DHCP6 relay */
|
||||
services_dhcrelay6_configure();
|
||||
services_dhcrelay_configure(true);
|
||||
services_dhcrelay6_configure(true);
|
||||
|
||||
/* dyndns service updates */
|
||||
mwexec("/usr/local/etc/rc.dyndns.update");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user