diff options
author | Christian Hesse <mail@eworm.de> | 2019-08-29 13:58:18 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-08-30 11:03:43 +0200 |
commit | 8c8d7f93f19778b9a41e7dc647c42db2a9a3a945 (patch) | |
tree | 13415b1324477155bfd973d465017a5646c2d236 | |
parent | f559c4ac929c1a850875a5d7cccf72a0a9b9f64e (diff) |
ipv6-update: get values into array
... and concatenate name and regexp - just either of both is set.
-rw-r--r-- | ipv6-update | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ipv6-update b/ipv6-update index 5d5a3dc..e21e6bb 100644 --- a/ipv6-update +++ b/ipv6-update @@ -25,7 +25,8 @@ if ($OldPrefix != $PdPrefix) do={ / ipv6 firewall address-list set address=$PdPrefix $AddrList; :foreach Record in=[ / ip dns static find where comment~("^ipv6-pool-" . $Pool . ",") ] do={ - :local Comment [ $ParseKeyValueStore [ / ip dns static get $Record comment ] ]; + :local RecordVal [ / ip dns static get $Record ]; + :local Comment [ $ParseKeyValueStore ($RecordVal->"comment") ]; :local Prefix [ / ipv6 address get [ find where interface=($Comment->"interface") from-pool=$Pool global ] address ]; :set Prefix [ :pick $Prefix 0 [ :find $Prefix "::/64" ] ]; @@ -33,12 +34,8 @@ if ($OldPrefix != $PdPrefix) do={ :set Prefix ($Prefix . ":"); } - :local Name [ / ip dns static get $Record name ]; - :if ([ :len $Name ] = 0) do={ - :set Name [ / ip dns static get $Record regex ]; - } - - :log info ("Updating DNS record for " . $Name . " to " . $Prefix . ":" . ($Comment->"suffix")); + :log info ("Updating DNS record for " . ($RecordVal->"name") . ($RecordVal->"regexp") . \ + " to " . $Prefix . ":" . ($Comment->"suffix")); / ip dns static set address=($Prefix . ":" . ($Comment->"suffix")) $Record; } } |