mirror of
https://github.com/opnsense/core.git
synced 2026-05-28 04:34:51 -04:00
Captive Portal: reload ipfw on captive portal reconfigure (#10253)
This commit is contained in:
parent
6e10711078
commit
1bf1c693da
1 changed files with 19 additions and 0 deletions
|
|
@ -29,6 +29,7 @@
|
|||
namespace OPNsense\CaptivePortal\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableServiceControllerBase;
|
||||
use OPNsense\Core\Backend;
|
||||
|
||||
/**
|
||||
* Class ServiceController
|
||||
|
|
@ -40,6 +41,24 @@ class ServiceController extends ApiMutableServiceControllerBase
|
|||
protected static $internalServiceTemplate = 'OPNsense/Captiveportal';
|
||||
protected static $internalServiceName = 'captiveportal';
|
||||
|
||||
public function reconfigureAction()
|
||||
{
|
||||
$status = ['status' => 'failed'];
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$backend = new Backend();
|
||||
$backend->configdRun('template reload OPNsense/IPFW');
|
||||
$result = trim($backend->configdRun("ipfw reload"));
|
||||
if ($result != "OK") {
|
||||
return ["status" => "error reloading ipfw (" . $result . ")"];
|
||||
}
|
||||
|
||||
$status = parent::reconfigureAction();
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
protected function serviceEnabled()
|
||||
{
|
||||
return $this->getModel()->isEnabled();
|
||||
|
|
|
|||
Loading…
Reference in a new issue