dns/rfc2136: port to plugins_argument_map()

This commit is contained in:
Franco Fichtner
2024-09-26 09:37:08 +02:00
parent 110f48dae1
commit ebc0085ba8
2 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
PLUGIN_NAME= rfc2136
PLUGIN_VERSION= 1.9
PLUGIN_REVISION= 1
PLUGIN_REVISION= 2
PLUGIN_COMMENT= RFC-2136 Support
PLUGIN_MAINTAINER= franco@opnsense.org
PLUGIN_DEPENDS= bind-tools
@@ -91,19 +91,16 @@ function rfc2136_configure_do($verbose = false, $int = null, $updatehost = '', $
{
global $config;
if (!rfc2136_enabled()) {
if (!rfc2136_enabled() || !plugins_argument_map($int)) {
return;
}
/* $int is passed as an optional CSV so transform into empty array when not set */
$int = !empty($int) ? explode(',', $int) : [];
service_log('Configuring RFC 2136 clients...', $verbose);
foreach ($config['dnsupdates']['dnsupdate'] as $i => $dnsupdate) {
if (!isset($dnsupdate['enable'])) {
continue;
} elseif (count($int) && !in_array($dnsupdate['interface'], $int)) {
} elseif (!empty($int) && !in_array($dnsupdate['interface'], $int)) {
continue;
} elseif (!empty($updatehost) && ($updatehost != $dnsupdate['host'])) {
continue;