aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-04-28 10:11:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-04-28 10:39:23 +0200
commit006e054517954b4bf97f11f9d9a5061bf32d3a3e (patch)
treecb6caf30ac3c41302a6687db2e68bd7378dbbf7b
parentd9c4e1e8d5cdc1beb447cfbc2d7c6fc2c672d082 (diff)
global-functions: set $0 with script name
Now that we have some active code at the bottom... (cherry picked from commit 9bc2123ee5bd7af4a8e1ca47696a3f3379d5a028)
-rw-r--r--global-functions6
1 files changed, 4 insertions, 2 deletions
diff --git a/global-functions b/global-functions
index 65646ad..a86c1ea 100644
--- a/global-functions
+++ b/global-functions
@@ -7,6 +7,8 @@
# global functions
# https://git.eworm.de/cgit/routeros-scripts/about/
+:local 0 "global-functions";
+
# expected configuration version
:global ExpectedConfigVersion 79;
@@ -1273,10 +1275,10 @@
}
# check for required RouterOS version
-$RequiredRouterOS "global-functions" "6.47" true;
+$RequiredRouterOS $0 "6.47" true;
# ... and give a hint on RouterOS v7.
-:if ([ $RequiredRouterOS "global-functions" "7.0" false ] = true) do={
+:if ([ $RequiredRouterOS $0 "7.0" false ] = true) do={
$LogPrintExit2 warning $0 ("RouterOS v7 brings some incompatible changes. Please switch to main branch!") false;
}