From 500d0679ed5989ae0bb6fbd71ebf7e9e7b1ef86e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 20 Dec 2021 15:31:34 +0100 Subject: global-functions: $RequiredRouterOS: fix warning Passing a boolean does not work... Handle as string. --- global-functions | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 4ff2a7a..e89587f 100644 --- a/global-functions +++ b/global-functions @@ -632,16 +632,15 @@ # check for required RouterOS version :set RequiredRouterOS do={ - :local Caller [ :tostr $1 ]; - :local Required [ :tostr $2 ]; - :local Warn [ :tobool $3 ]; + :local Caller [ :tostr $1 ]; + :local Required [ :tostr $2 ]; + :local Warn [ :tostr $3 ]; :global IfThenElse; :global LogPrintExit2; :global VersionToNum; - :if ([ $VersionToNum $Required ] > [ $VersionToNum [ / system package update get installed-version ] ]) do={ - :if ($Warn = true) do={ + :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; } -- cgit v1.2.3-70-g09d2