aboutsummaryrefslogtreecommitdiffstats
path: root/update-gre-address
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-22 15:14:10 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-24 21:51:54 +0100
commitf46db918453dcb8878b9a0de6e122fb0ea2224d9 (patch)
tree31544a450651d0705ecdea0c3d35e650ef784d67 /update-gre-address
parentb0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff)
global: give script or function name in log messages
Diffstat (limited to 'update-gre-address')
-rw-r--r--update-gre-address5
1 files changed, 3 insertions, 2 deletions
diff --git a/update-gre-address b/update-gre-address
index 50d1373..af57d2d 100644
--- a/update-gre-address
+++ b/update-gre-address
@@ -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;
}