unbound: don't stop unbound_dhcpd twice, small refactor

Also see: https://www.reddit.com/r/OPNsenseFirewall/comments/aac7xj/does_this_pfsense_dns_bug_with_dhcp_and_multiple/
This commit is contained in:
Franco Fichtner 2019-01-04 07:42:12 +01:00
parent dbd1729595
commit fada24d7c3

View File

@ -438,12 +438,11 @@ function unbound_configure_do($verbose = false, $interface = '')
unbound_generate_config();
$domain = $config['system']['domain'];
if (isset($config['unbound']['regdhcpdomain'])) {
$domain = $config['unbound']['regdhcpdomain'];
}
killbypid('/var/run/unbound_dhcpd.pid', 'TERM', true);
if (isset($config['unbound']['regdhcp'])) {
$domain = $config['system']['domain'];
if (isset($config['unbound']['regdhcpdomain'])) {
$domain = $config['unbound']['regdhcpdomain'];
}
mwexecf('/usr/local/opnsense/scripts/dns/unbound_dhcpd.py /domain %s', $domain);
}
mwexecf('/usr/local/sbin/unbound -c %s', '/var/unbound/unbound.conf');