mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
update-gre-address: use $LogPrintExit
This commit is contained in:
parent
0045690459
commit
d2b1f036ca
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,8 @@
|
||||||
# ipsec remote peer
|
# ipsec remote peer
|
||||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md
|
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md
|
||||||
|
|
||||||
|
:global LogPrintExit;
|
||||||
|
|
||||||
/ 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={
|
||||||
|
@ -16,7 +18,7 @@
|
||||||
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
|
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
|
||||||
($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || \
|
($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || \
|
||||||
$GreIntVal->"disabled" = true)) do={
|
$GreIntVal->"disabled" = true)) do={
|
||||||
:log info ("Updating remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address");
|
$LogPrintExit info ("Updating remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address") false;
|
||||||
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where remote-address=$PeerVal->"dynamic-address" name!=$GreIntVal->"name" ];
|
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where remote-address=$PeerVal->"dynamic-address" name!=$GreIntVal->"name" ];
|
||||||
/ interface gre set $GreInt remote-address=($PeerVal->"dynamic-address") disabled=no;
|
/ interface gre set $GreInt remote-address=($PeerVal->"dynamic-address") disabled=no;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue