aboutsummaryrefslogtreecommitdiffstats
path: root/config/unbound
diff options
context:
space:
mode:
Diffstat (limited to 'config/unbound')
-rw-r--r--config/unbound/unbound.inc20
-rw-r--r--config/unbound/unbound.xml3
2 files changed, 13 insertions, 10 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc
index 7f2fc973..3392c6a2 100644
--- a/config/unbound/unbound.inc
+++ b/config/unbound/unbound.inc
@@ -59,9 +59,6 @@ function unbound_initial_setup() {
// Setup rc file for startup and shutdown.
unbound_rc_setup();
-
- // Disable DNSMasq and enable UNBound
- $unbound_config['unbound_status'] = "on";
// Set initial interfaces that are allowed to query to lan, if that does not exist set it to the wan
if(count($config['interfaces']) > 1)
@@ -389,8 +386,16 @@ function fetch_root_hints() {
}
}
+function unbound_validate($post) {
+ global $config, $input_errors;
+
+ if($_POST['unbound_status'] == "on" && isset($config['dnsmasq']['enable']))
+ $input_errors[] = "The system dns-forwarder is still active. Disable it before enabling the Unbound service.";
+
+}
+
function unbound_reconfigure() {
- global $config,$g;
+ global $config, $g, $input_errors;
$unbound_config = $config['installedpackages']['unbound']['config'][0];
@@ -399,18 +404,13 @@ function unbound_reconfigure() {
unbound_control("termstop");
}
} else {
- if(isset($config['dnsmasq']['enable'])) {
- unset($config['dnsmasq']['enable']);
- sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
- }
if(is_service_running("unbound")) {
unbound_control("termstop");
}
unbound_resync_config();
unbound_control("start");
unbound_control("forward");
- }
-
+ }
}
function unbound_uninstall() {
diff --git a/config/unbound/unbound.xml b/config/unbound/unbound.xml
index b0bfcc16..f7a851eb 100644
--- a/config/unbound/unbound.xml
+++ b/config/unbound/unbound.xml
@@ -177,6 +177,9 @@
<custom_add_php_command>
</custom_add_php_command>
<custom_php_command_before_form/>
+ <custom_php_validation_command>
+ unbound_validate($_POST);
+ </custom_php_validation_command>
<custom_php_resync_config_command>
unbound_reconfigure();
</custom_php_resync_config_command>