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