mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
services: dhcpd6 is its own service; closes #1027
This commit is contained in:
parent
4dde1f08f2
commit
a4bb9cd515
@ -412,7 +412,7 @@ function services_dhcpd_configure($family = 'all', $blacklist = array())
|
||||
}
|
||||
}
|
||||
|
||||
function is_dhcp_server_enabled()
|
||||
function is_dhcpv4_server_enabled()
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -440,7 +440,7 @@ function services_dhcpdv4_configure()
|
||||
killbypid("{$g['dhcpd_chroot_path']}/var/run/dhcpd.pid");
|
||||
|
||||
/* DHCP enabled on any interfaces? */
|
||||
if (!is_dhcp_server_enabled()) {
|
||||
if (!is_dhcpv4_server_enabled()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2542,16 +2542,26 @@ function services_get()
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (is_dhcp_server_enabled()) {
|
||||
if (is_dhcpv4_server_enabled()) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = "dhcpd";
|
||||
$pconfig['description'] = gettext("DHCP Service");
|
||||
$pconfig['php']['restart'] = array('services_dhcpd_configure');
|
||||
$pconfig['php']['start'] = array('services_dhcpd_configure');
|
||||
$pconfig['name'] = 'dhcpd';
|
||||
$pconfig['description'] = gettext("DHCP Server");
|
||||
$pconfig['php']['restart'] = array('services_dhcpdv4_configure');
|
||||
$pconfig['php']['start'] = array('services_dhcpdv4_configure');
|
||||
$pconfig['pidfile'] = "{$g['dhcpd_chroot_path']}/var/run/dhcpd.pid";
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (is_dhcpv6_server_enabled()) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = 'dhcpd6';
|
||||
$pconfig['description'] = gettext("DHCPv6 Server");
|
||||
$pconfig['php']['restart'] = array('services_dhcpdv6_configure');
|
||||
$pconfig['php']['start'] = array('services_dhcpdv6_configure');
|
||||
$pconfig['pidfile'] = "{$g['dhcpd_chroot_path']}/var/run/dhcpdv6.pid";
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (is_apinger_enabled()) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = "apinger";
|
||||
|
||||
@ -345,8 +345,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
|
||||
}
|
||||
|
||||
$service_hook = 'dhcpd';
|
||||
$service_hook = 'dhcpd6';
|
||||
|
||||
legacy_html_escape_form_data($pconfig);
|
||||
|
||||
include("head.inc");
|
||||
|
||||
?>
|
||||
|
||||
@ -108,11 +108,11 @@ include("head.inc");
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
|
||||
<section class="col-xs-12">
|
||||
<?php if ($dhcpd_enabled):
|
||||
print_info_box(gettext('The DHCPv6 server is currently enabled. Cannot enable the DHCPv6 relay while the DHCPv6 server is enabled on any interface.'));
|
||||
else: ?>
|
||||
<div class="content-box">
|
||||
<form method="post" name="iform" id="iform">
|
||||
<?php if ($dhcpd_enabled): ?>
|
||||
<p><?= gettext('DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.') ?></p>
|
||||
<?php else: ?>
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped opnsense_standard_table_form">
|
||||
@ -179,10 +179,10 @@ include("head.inc");
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -369,10 +369,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
exit;
|
||||
}
|
||||
|
||||
$service_hook = 'dhcpd';
|
||||
include("head.inc");
|
||||
?>
|
||||
$service_hook = 'dhcpd6';
|
||||
|
||||
include("head.inc");
|
||||
|
||||
?>
|
||||
<body>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user