mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
add wrapper for background events to legacy code, fix gui reload
This commit is contained in:
parent
a825ec10d1
commit
a2800ad0d4
@ -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");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user