diff options
author | Christian Hesse <mail@eworm.de> | 2022-10-18 22:36:03 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-10-18 22:43:42 +0200 |
commit | 2f8e8b74487b36fe8ed233570115767ca3a13ec6 (patch) | |
tree | 393a363a804873fc1f22c77be112996012262363 /update-gre-address | |
parent | 640cb811195579a3444d53531160f2bbb88e2d55 (diff) |
update-gre-address: strip "CN=" from peer's idrouteros-7.6-1
The prefix "CN=" is now added in RouterOS 7.6... Let's match with and
without the prefix in comment.
Diffstat (limited to 'update-gre-address')
-rw-r--r-- | update-gre-address | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/update-gre-address b/update-gre-address index d1402e3..a94616a 100644 --- a/update-gre-address +++ b/update-gre-address @@ -11,13 +11,14 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:global CharacterReplace; :global LogPrintExit2; /interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ]; :foreach Peer in=[ /ip/ipsec/active-peers/find ] do={ :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={ :local GreIntVal [ /interface/gre/get $GreInt ]; :if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \ |