diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableServiceControllerBase.php b/src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableServiceControllerBase.php index d8cd14796..a1294893f 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableServiceControllerBase.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableServiceControllerBase.php @@ -158,6 +158,14 @@ abstract class ApiMutableServiceControllerBase extends ApiControllerBase return 1; } + /** + * invoke interface registration check, return true to invoke configd action + */ + protected function invokeInterfaceRegistration() + { + return false; + } + /** * reconfigure with optional stop, generate config and start / reload * @return array response message @@ -178,7 +186,9 @@ abstract class ApiMutableServiceControllerBase extends ApiControllerBase ) { $backend->configdRun(escapeshellarg(static::$internalServiceName) . ' stop'); } - + if ($this->invokeInterfaceRegistration()) { + $backend->configdRun('interface invoke registration'); + } $backend->configdRun('template reload ' . escapeshellarg(static::$internalServiceTemplate)); if ((string)$model->getNodeByReference(static::$internalServiceEnabled) == '1') { diff --git a/src/opnsense/service/conf/actions.d/actions_interface.conf b/src/opnsense/service/conf/actions.d/actions_interface.conf index 3407b378b..cc18ea12e 100644 --- a/src/opnsense/service/conf/actions.d/actions_interface.conf +++ b/src/opnsense/service/conf/actions.d/actions_interface.conf @@ -47,6 +47,13 @@ parameters: type:script message:update carp service status +[invoke.registration] +command: /usr/local/sbin/pluginctl -i +parameters: +type:script +message: invoke dynamic interface registration + + [list.arp] command:/usr/local/opnsense/scripts/interfaces/list_arp.py parameters:%s %s