Commit a4fab55b authored by Ad Schellevis's avatar Ad Schellevis

make reconfigure aware of the model

parent 62d5f7d2
......@@ -30,6 +30,7 @@ namespace OPNsense\Proxy\Api;
use \OPNsense\Base\ApiControllerBase;
use \OPNsense\Core\Backend;
use \OPNsense\Proxy\General;
/**
* Class ServiceController
......@@ -97,14 +98,20 @@ class ServiceController extends ApiControllerBase
*/
public function reconfigureAction()
{
$mdlGeneral = new General();
$backend = new Backend();
$backend->sendEvent("template reload OPNsense.Proxy");
$runStatus = $this->statusAction();
if ($runStatus['status'] == "running") {
$backend->sendEvent("service reconfigure proxy");
} else {
if ($mdlGeneral->enabled->__toString() == 1) {
$backend->sendEvent("service reconfigure proxy");
} else {
$this->stopAction();
}
} elseif ($mdlGeneral->enabled->__toString() == 1) {
$this->startAction();
}
......
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