Commit 984522a7 authored by Ad Schellevis's avatar Ad Schellevis

update squid reconfigure action

parent 231f818c
......@@ -98,22 +98,30 @@ class ServiceController extends ApiControllerBase
*/
public function reconfigureAction()
{
// close session for long running action
session_write_close();
$mdlGeneral = new General();
$backend = new Backend();
$backend->sendEvent("template reload OPNsense.Proxy");
$runStatus = $this->statusAction();
if ($runStatus['status'] == "running") {
if ($mdlGeneral->enabled->__toString() == 1) {
$backend->sendEvent("service reconfigure proxy");
} else {
// stop squid when disabled
if ($runStatus['status'] == "running" && $mdlGeneral->enabled->__toString() == 0) {
$this->stopAction();
}
} elseif ($mdlGeneral->enabled->__toString() == 1) {
// generate template
$backend->sendEvent("template reload OPNsense.Proxy");
// (res)start daemon
if ($mdlGeneral->enabled->__toString() == 1) {
if ($runStatus['status'] == "running") {
$backend->sendEvent("service reconfigure proxy");
} else {
$this->startAction();
}
}
return array("status" => "ok");
}
......
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