aboutsummaryrefslogtreecommitdiffstats
path: root/config/unbound
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2011-03-02 14:40:34 +0200
committerWarren Baker <warren@decoy.co.za>2011-03-02 14:40:34 +0200
commit4923b798bf6c6ca94d1eac2001a8b65065c62fed (patch)
tree6f33be46620a14d8a7b6fed8360b3461dea3f5e7 /config/unbound
parentdea5e92af1fe2f6a93a09d40f5d81e1a1bd9a6dc (diff)
downloadpfsense-packages-4923b798bf6c6ca94d1eac2001a8b65065c62fed.tar.gz
pfsense-packages-4923b798bf6c6ca94d1eac2001a8b65065c62fed.tar.bz2
pfsense-packages-4923b798bf6c6ca94d1eac2001a8b65065c62fed.zip
make sure restoration of cache works and doesnt try to get loaded before Unbound is started.
Diffstat (limited to 'config/unbound')
-rw-r--r--config/unbound/unbound.inc19
1 files changed, 9 insertions, 10 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc
index 370c56f6..d95961f5 100644
--- a/config/unbound/unbound.inc
+++ b/config/unbound/unbound.inc
@@ -219,9 +219,8 @@ function unbound_control($action) {
case "restore_cache":
//Restore Unbound's Cache
if($unbound_config['dumpcache'] == "on") {
- $cache_dumpfile = "/var/tmp/unbound_cache";
- if(file_exists($cache_dumpfile))
- unbound_ctl_exec("load_cache < $cache_dumpfile");
+ if(file_exists($cache_dumpfile) && filesize($cache_dumpfile) > 0)
+ unbound_ctl_exec("load_cache < /var/tmp/unbound_cache");
}
break;
@@ -567,15 +566,13 @@ function unbound_validate($post, $acl=false) {
}
function unbound_reconfigure() {
- global $config, $g, $input_errors;
+ global $config;
$unbound_config = $config['installedpackages']['unbound']['config'][0];
-
+
if ($unbound_config['unbound_status'] != "on") {
- if(is_service_running("unbound")) {
- unbound_control("dump_cache");
+ if(is_service_running("unbound"))
unbound_control("termstop");
- }
} else {
if(is_service_running("unbound")) {
unbound_control("dump_cache");
@@ -583,8 +580,10 @@ function unbound_reconfigure() {
}
unbound_resync_config();
unbound_control("start");
- unbound_control("restore_cache");
- unbound_control("forward");
+ if(is_service_running("unbound")) {
+ unbound_control("forward");
+ unbound_control("restore_cache");
+ }
}
}