Commit 2835c174 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

rename execute_unbound_command -> unbound_execute

(cherry picked from commit 9494ef66)
parent f62ad589
...@@ -382,7 +382,7 @@ EOF; ...@@ -382,7 +382,7 @@ EOF;
file_put_contents("{$g['unbound_chroot_path']}/remotecontrol.conf", $remotcfg); file_put_contents("{$g['unbound_chroot_path']}/remotecontrol.conf", $remotcfg);
// Generate our keys // Generate our keys
execute_unbound_command("unbound-control-setup"); unbound_execute("unbound-control-setup");
} }
} }
...@@ -422,17 +422,17 @@ function sync_unbound_service() ...@@ -422,17 +422,17 @@ function sync_unbound_service()
bootstrap_unbound_root(); bootstrap_unbound_root();
// Configure our Unbound service // Configure our Unbound service
execute_unbound_command("unbound-anchor"); unbound_execute("unbound-anchor");
unbound_remote_control_setup(); unbound_remote_control_setup();
unbound_generate_config(); unbound_generate_config();
execute_unbound_command("start"); unbound_execute("start");
if (is_process_running('unbound')) { if (is_process_running('unbound')) {
execute_unbound_command("restore_cache"); unbound_execute("restore_cache");
} }
} }
// Execute commands as the user unbound // Execute commands as the user unbound
function execute_unbound_command($cmd) function unbound_execute($cmd)
{ {
global $g, $config; global $g, $config;
...@@ -604,31 +604,31 @@ function unbound_control($action) { ...@@ -604,31 +604,31 @@ function unbound_control($action) {
// Start Unbound // Start Unbound
if ($config['unbound']['enable'] == "on") { if ($config['unbound']['enable'] == "on") {
if (!is_process_running("unbound")) { if (!is_process_running("unbound")) {
execute_unbound_command("start"); unbound_execute("start");
} }
} }
break; break;
case "stop": case "stop":
if ($config['unbound']['enable'] == "on") { if ($config['unbound']['enable'] == "on") {
execute_unbound_command("stop"); unbound_execute("stop");
} }
break; break;
case "reload": case "reload":
if ($config['unbound']['enable'] == "on") { if ($config['unbound']['enable'] == "on") {
execute_unbound_command("reload"); unbound_execute("reload");
} }
break; break;
case "dump_cache": case "dump_cache":
// Dump Unbound's Cache // Dump Unbound's Cache
if ($config['unbound']['dumpcache'] == "on") { if ($config['unbound']['dumpcache'] == "on") {
execute_unbound_command("dump_cache"); unbound_execute("dump_cache");
} }
break; break;
case "restore_cache": case "restore_cache":
// Restore Unbound's Cache // Restore Unbound's Cache
if ((is_process_running("unbound")) && ($config['unbound']['dumpcache'] == "on")) { if ((is_process_running("unbound")) && ($config['unbound']['dumpcache'] == "on")) {
if (file_exists($cache_dumpfile) && filesize($cache_dumpfile) > 0) { if (file_exists($cache_dumpfile) && filesize($cache_dumpfile) > 0) {
execute_unbound_command("load_cache < /tmp/unbound_cache"); unbound_execute("load_cache < /tmp/unbound_cache");
} }
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment