Commit 54f0787c authored by Ad Schellevis's avatar Ad Schellevis

(ids) add reloadRules action to api

parent 1e1aae8b
...@@ -205,6 +205,28 @@ class ServiceController extends ApiControllerBase ...@@ -205,6 +205,28 @@ class ServiceController extends ApiControllerBase
return array("status" => $status); return array("status" => $status);
} }
/**
* flush rule configuration to config and reload suricata ruleset (graceful restart)
* @return array
*/
public function reloadRulesAction()
{
$status = "failed";
if ($this->request->isPost()) {
// close session for long running action
$this->sessionClose();
$backend = new Backend();
// flush rule configuration
$bckresult = trim($backend->configdRun("template reload OPNsense.IDS"));
if ($bckresult == "OK") {
$status = $backend->configdRun("ids reload", $detach);
} else {
$status = "template error";
}
}
return array("status" => $status);
}
/** /**
* query suricata alerts * query suricata alerts
* @return array * @return array
......
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