mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-22 17:53:31 +02:00
ipv6-update: ignore if prefix is no longer valid
This commit is contained in:
parent
6331505dbe
commit
33c02e0609
1 changed files with 8 additions and 0 deletions
|
@ -20,7 +20,9 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:local NaAddress $"na-address";
|
:local NaAddress $"na-address";
|
||||||
|
:local NaValid $"na-valid";
|
||||||
:local PdPrefix $"pd-prefix";
|
:local PdPrefix $"pd-prefix";
|
||||||
|
:local PdValid $"pd-valid";
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:set ExitOK true;
|
||||||
|
@ -39,6 +41,12 @@
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:if ($PdValid != 1) do={
|
||||||
|
$LogPrint info $ScriptName ("The prefix " . $PdPrefix . " is no longer valid. Ignoring.");
|
||||||
|
:set ExitOK true;
|
||||||
|
:error false;
|
||||||
|
}
|
||||||
|
|
||||||
:local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ];
|
:local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ];
|
||||||
:if ([ :len [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={
|
:if ([ :len [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={
|
||||||
/ipv6/firewall/address-list/add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool) dynamic=yes;
|
/ipv6/firewall/address-list/add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool) dynamic=yes;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue