mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 17:54:36 +02:00
global: give script or function name in log messages
This commit is contained in:
parent
b0e52aa2d1
commit
f46db91845
46 changed files with 262 additions and 212 deletions
|
@ -7,10 +7,11 @@
|
|||
# ipsec remote peer
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-gre-address.md
|
||||
|
||||
:local 0 "update-gre-address";
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit;
|
||||
:global LogPrintExit2;
|
||||
|
||||
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
|
||||
|
||||
|
@ -22,7 +23,7 @@
|
|||
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
|
||||
($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || \
|
||||
$GreIntVal->"disabled" = true)) do={
|
||||
$LogPrintExit info ("Updating remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address") false;
|
||||
$LogPrintExit2 info $0 ("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 $GreInt remote-address=($PeerVal->"dynamic-address") disabled=no;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue