summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2017-02-22 01:00:37 +0100
committerGitHub <noreply@github.com>2017-02-22 01:00:37 +0100
commit3d8b01e8c6392b4177572d540c8160c7e6e071ca (patch)
tree698e6b5022ba20b354f77e0532206821f37c958f
parentaba748830d69b05df8c4a4cee370413c91c32273 (diff)
downloadpfsense-3d8b01e8c6392b4177572d540c8160c7e6e071ca.zip
pfsense-3d8b01e8c6392b4177572d540c8160c7e6e071ca.tar.gz
Only start dhcpleases if DHCP server is enabled (Bug #6750)
-rw-r--r--src/etc/inc/system.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 028583b..61b6a77 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -570,12 +570,15 @@ function system_hosts_generate() {
function system_dhcpleases_configure() {
global $config, $g;
-
+ if (!function_exists('is_dhcp_server_enabled')) {
+ require_once('pfsense-utils.inc');
+ }
$pidfile = "{$g['varrun_path']}/dhcpleases.pid";
/* Start the monitoring process for dynamic dhcpclients. */
- if ((isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcp'])) ||
- (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcp']))) {
+ if (((isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcp'])) ||
+ (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcp']))) &&
+ (is_dhcp_server_enabled())) {
/* Make sure we do not error out */
mwexec("/bin/mkdir -p {$g['dhcpd_chroot_path']}/var/db");
if (!file_exists("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases")) {
OpenPOWER on IntegriCloud