mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-22 11:54:44 +02:00
ipv6-update: simplify the code...
... and make it match the code used in other scripts.
This commit is contained in:
parent
4368f500c3
commit
241d5fd2d7
1 changed files with 3 additions and 4 deletions
|
@ -16,12 +16,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:local Pool [ / ipv6 pool get [ find where prefix=$PdPrefix ] name ];
|
:local Pool [ / ipv6 pool get [ find where prefix=$PdPrefix ] name ];
|
||||||
:local AddrList [ / ipv6 firewall address-list find where comment=("ipv6-pool-" . $Pool) ];
|
:if ([ :len [ / ipv6 firewall address-list find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={
|
||||||
:if ([ :len $AddrList ] = 0) do={
|
|
||||||
:log info ("Missing ipv6 address list entry for ipv6-pool-" . $Pool . ", adding.");
|
|
||||||
/ ipv6 firewall address-list add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool);
|
/ ipv6 firewall address-list add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool);
|
||||||
:set AddrList [ / ipv6 firewall address-list find where comment=("ipv6-pool-" . $Pool) ];
|
:log warning ("Added ipv6 address list entry for ipv6-pool-" . $Pool . ".");
|
||||||
}
|
}
|
||||||
|
:local AddrList [ / ipv6 firewall address-list find where comment=("ipv6-pool-" . $Pool) ];
|
||||||
:local OldPrefix [ / ipv6 firewall address-list get ($AddrList->0) address ];
|
:local OldPrefix [ / ipv6 firewall address-list get ($AddrList->0) address ];
|
||||||
|
|
||||||
:if ($OldPrefix != $PdPrefix) do={
|
:if ($OldPrefix != $PdPrefix) do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue