summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2012-02-03 22:28:16 +0200
committerWarren Baker <warren@decoy.co.za>2012-02-03 22:28:16 +0200
commita748b37228bef41f3e3a423cc021bd9c3c4722a2 (patch)
treeb181425a4e03fb55e0ab9f89b5d86b2c9fa9b238 /etc/inc
parent5a7e41e670ca6d6f087b1c55933ce014557e9819 (diff)
downloadpfsense-a748b37228bef41f3e3a423cc021bd9c3c4722a2.zip
pfsense-a748b37228bef41f3e3a423cc021bd9c3c4722a2.tar.gz
Rename function and use variable
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/unbound.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc
index 614d38d..cedd4b4 100644
--- a/etc/inc/unbound.inc
+++ b/etc/inc/unbound.inc
@@ -72,7 +72,6 @@ function unbound_add_domain_overrides($pvt=false) {
file_put_contents("{$g['unbound_chroot_path']}/etc/domainoverrides.conf", $domain_entries);
}
-
/* Optimize Unbound for environment */
function unbound_optimization() {
global $config;
@@ -150,6 +149,7 @@ function unbound_fetch_root_hints_using_dig() {
return true;
}
+/* Fetch root name servers hints file */
function unbound_fetch_root_hints() {
global $g;
@@ -216,7 +216,8 @@ EOF;
return $stats;
}
-function unbound_resync_config() {
+/* Generate Unbound configuration */
+function unbound_generate_config() {
global $config,$g;
$unboundcfg = $config['unbound'];
@@ -225,7 +226,7 @@ function unbound_resync_config() {
$optimization = unbound_optimization();
/* Setup DNSSEC support */
- if($unbound_config['dnssec_status'] == "on") {
+ if($unboundcfg['dnssec_status'] == "on") {
$module_config = "validator iterator";
$anchor_file = "auto-trust-anchor-file: /etc/root-trust-anchor";
} else
@@ -246,7 +247,7 @@ EOF;
}
/* Allow DNS Rebind for forwarded domains */
- if (isset($config['unbound']['domainoverrides']) && is_array($config['unbound']['domainoverrides'])) {
+ if (isset($unboundcfg['domainoverrides']) && is_array($unboundcfg['domainoverrides'])) {
if(!isset($config['system']['webgui']['nodnsrebindcheck'])) {
$private_domains = "# Set private domains in case authoritative name server returns a Private IP address";
$private_domains .= unbound_add_domain_overrides(true);
@@ -263,9 +264,9 @@ EOF;
$statistics = unbound_statistics();
/* Add custom Unbound options */
- if ($config['unbound']['custom_options']) {
+ if ($unboundcfg['custom_options']) {
$custom_option = "# Unbound custom option";
- foreach (preg_split('/\s+/', $config['dns']['custom_options']) as $ent)
+ foreach (preg_split('/\s+/', $unboundcfg['custom_options']) as $ent)
$custom_option .= $ent."\n";
}
@@ -344,6 +345,7 @@ EOD;
file_put_contents("{$g['unbound_chroot_path']}/etc/unbound.conf", $unboundconf);
+ return 0;
}
function unbound_remote_control_setup() {
OpenPOWER on IntegriCloud