aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-09-01 14:05:55 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-09-01 14:05:55 +0200
commit832e899cdac69736cc4f7e0ec9ef30fd0c71f5f3 (patch)
tree0a3b448abc5ec03e6278facc7d6067e59315e4fe
parentae8e22941ebb31d472ca185d0a5bb2fa9b7a19ca (diff)
global-functions: $RequiredRouterOS: allow to use without warning
-rw-r--r--global-functions15
1 files changed, 9 insertions, 6 deletions
diff --git a/global-functions b/global-functions
index 17075f9..69fda07 100644
--- a/global-functions
+++ b/global-functions
@@ -84,7 +84,7 @@
}
}
- :if ([ $RequiredRouterOS $0 "6.47" ] = false) do={
+ :if ([ $RequiredRouterOS $0 "6.47" true ] = false) do={
:return true;
}
@@ -661,16 +661,19 @@
# check for required RouterOS version
:set RequiredRouterOS do={
- :local Caller [ :tostr $1 ];
- :local Required [ :tostr $2 ];
+ :local Caller [ :tostr $1 ];
+ :local Required [ :tostr $2 ];
+ :local Warn [ :tobool $3 ];
:global IfThenElse;
:global LogPrintExit2;
:global VersionToNum;
:if ([ $VersionToNum $Required ] > [ $VersionToNum [ / system package update get installed-version ] ]) do={
- $LogPrintExit2 warning $0 ("This " . [ $IfThenElse ([ :pick $Caller 0 ] = "\$") "function" "script" ] . \
- " '" . $Caller . "' (at least specific functionality) requires RouterOS " . $Required . ". Please update!") false;
+ :if ($Warn = true) do={
+ $LogPrintExit2 warning $0 ("This " . [ $IfThenElse ([ :pick $Caller 0 ] = "\$") "function" "script" ] . \
+ " '" . $Caller . "' (at least specific functionality) requires RouterOS " . $Required . ". Please update!") false;
+ }
:return false;
}
:return true;
@@ -1316,7 +1319,7 @@
}
# check for required RouterOS version
-$RequiredRouterOS "global-functions" "6.47";
+$RequiredRouterOS "global-functions" "6.47" true;
# signal we are ready
:set GlobalFunctionsReady true;