mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
update-gre-address: strip "CN=" from peer's id
The prefix "CN=" is now added in RouterOS 7.6... Let's match with and without the prefix in comment.
This commit is contained in:
parent
640cb81119
commit
2f8e8b7448
1 changed files with 2 additions and 1 deletions
|
@ -11,13 +11,14 @@
|
||||||
:global GlobalFunctionsReady;
|
:global GlobalFunctionsReady;
|
||||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||||
|
|
||||||
|
:global CharacterReplace;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
|
||||||
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
||||||
|
|
||||||
:foreach Peer in=[ /ip/ipsec/active-peers/find ] do={
|
:foreach Peer in=[ /ip/ipsec/active-peers/find ] do={
|
||||||
:local PeerVal [ /ip/ipsec/active-peers/get $Peer ];
|
:local PeerVal [ /ip/ipsec/active-peers/get $Peer ];
|
||||||
:local GreInt [ /interface/gre/find where comment=$PeerVal->"id" ];
|
:local GreInt [ /interface/gre/find where comment=($PeerVal->"id") or comment=[ $CharacterReplace ($PeerVal->"id") "CN=" "" ] ];
|
||||||
:if ([ :len $GreInt ] > 0) do={
|
:if ([ :len $GreInt ] > 0) do={
|
||||||
:local GreIntVal [ /interface/gre/get $GreInt ];
|
:local GreIntVal [ /interface/gre/get $GreInt ];
|
||||||
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
|
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
|
||||||
|
|
Loading…
Reference in a new issue