Commit a2800ad0 authored by Ad Schellevis's avatar Ad Schellevis

add wrapper for background events to legacy code, fix gui reload

parent a825ec10
......@@ -149,6 +149,13 @@ function send_event($cmd)
return $backend->sendEvent("{$cmd}");
}
function send_background_event($cmd)
{
require_once("script/load_phalcon.php");
$backend = new OPNsense\Core\Backend();
return $backend->sendBackgroundEvent("{$cmd}");
}
function is_module_loaded($module_name) {
$module_name = str_replace(".ko", "", $module_name);
$running = 0;
......
......@@ -53,7 +53,7 @@ type:script
message:starting sshd
[reload|restart.webgui]
command:/usr/local/etc/rc.restart_webgui
command:sleep 2;/usr/local/etc/rc.restart_webgui
parameters:
type:script
message:webConfigurator restart in progress
......@@ -160,7 +160,7 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
send_event("&service restart webgui");
send_background_event("service restart webgui");
$savemsg .= "<br />" . gettext("WebGUI process is restarting.");
}
......
......@@ -615,7 +615,7 @@ if ($restart_webgui) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
send_event("&service restart webgui");
send_background_event("service restart webgui");
}
?>
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