diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-04 17:54:28 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-12 15:27:15 +0100 |
commit | c462c0b5983811d8a8b66e08184b38440941ff1c (patch) | |
tree | d798b765641787f0220ea1340327118e0d57b229 /global-functions.rsc | |
parent | d46156ad92322ffda1c7769d8eb9ea2b9fab6015 (diff) | |
parent | ada91536366d72e1a30c186be9289fb455ab3149 (diff) |
Merge branch 'no-error-on-exit' into nextrouteros-7.15beta4-1
Diffstat (limited to 'global-functions.rsc')
-rw-r--r-- | global-functions.rsc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 90148f8..6ddcbd3 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -328,7 +328,8 @@ } :if ([ $CertificateAvailable "R3" ] = false) do={ - $LogPrintExit2 error $0 ("Downloading required certificate failed.") true; + $LogPrintExit2 error $0 ("Downloading required certificate failed.") false; + :return false; } :local Url ("https://upgrade.mikrotik.com/routeros/" . $PkgVer . "/" . $PkgFile); @@ -1169,8 +1170,7 @@ # lock script against multiple invocation :set ScriptLock do={ :local Script [ :tostr $1 ]; - :local DoReturn $2; - :local WaitMax ([ :tonum $3 ] * 10); + :local WaitMax ([ :tonum $3 ] * 10); :global GetRandom20CharAlNum; :global IfThenElse; @@ -1285,13 +1285,13 @@ :if ([ $IsFirstTicket $Script $MyTicket ] = true && [ $TicketCount $Script ] = [ $JobCount $Script ]) do={ $RemoveTicket $Script $MyTicket; $CleanupTickets $Script; - :return false; + :return true; } $RemoveTicket $Script $MyTicket; $LogPrintExit2 info $0 ("Script '" . $Script . "' started more than once" . [ $IfThenElse ($WaitCount > 0) \ - " and timed out waiting for lock" "" ] . "... Aborting.") [ $IfThenElse ($DoReturn = true) false true ]; - :return true; + " and timed out waiting for lock" "" ] . "...") false; + :return false; } # send notification via NotificationFunctions - expects at least two string arguments |