diff options
author | Warren Baker <warren@decoy.co.za> | 2010-12-07 23:10:56 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2010-12-07 23:10:56 +0200 |
commit | 0d79daca0d90d702fcda50b756fed00491b4e728 (patch) | |
tree | 84303362b9ec6b072556cc2575aa29ee5fd68552 | |
parent | acfca044aaa531227dfd7a9a1ba8c94ef8f09d67 (diff) | |
download | pfsense-packages-0d79daca0d90d702fcda50b756fed00491b4e728.tar.gz pfsense-packages-0d79daca0d90d702fcda50b756fed00491b4e728.tar.bz2 pfsense-packages-0d79daca0d90d702fcda50b756fed00491b4e728.zip |
Add unbound_validation() to ensure that DNSMasq is not enabled, if so dont disable it but inform the user. Also dont assume Unbound should be set to 'on' but rather inform the user they need to configure it before it will be started.
-rw-r--r-- | config/unbound/unbound.inc | 20 | ||||
-rw-r--r-- | config/unbound/unbound.xml | 3 |
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> |