mirror of
https://github.com/opnsense/core.git
synced 2026-10-12 11:30:00 +00:00
Captive Portal: reload ipfw on captive portal reconfigure (#10253)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user