mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 10:35:27 +00:00
interfaces: call plugins_interfaces() optionally on service reconfigure when invokeInterfaceRegistration() returns true. closes https://github.com/opnsense/core/issues/5768
This commit is contained in:
parent
c760383ca4
commit
7c16c3b74f
@ -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') {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user