Captive Portal: reload ipfw on captive portal reconfigure (#10253)

This commit is contained in:
Stephan de Wit 2026-05-04 16:39:25 +02:00 committed by GitHub
parent 6e10711078
commit 1bf1c693da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();