aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index da6e112..bfb7b01 100644
--- a/global-functions
+++ b/global-functions
@@ -656,6 +656,12 @@
:global IfThenElse;
:global LogPrintExit2;
:global VersionToNum;
+
+ :if (!($Required ~ "^\\d+\\.\\d+((beta|rc|\\.)\\d+|)\$")) do={
+ $LogPrintExit2 error $0 ("No valid RouterOS version: " . $Required) false;
+ :return false;
+ }
+
:if ([ $VersionToNum $Required ] > [ $VersionToNum [ /system/package/update/get installed-version ] ]) do={
:if ($Warn = "true") do={
$LogPrintExit2 warning $0 ("This " . [ $IfThenElse ([ :pick $Caller 0 ] = ("\$")) "function" "script" ] . \