1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

global-functions: $ScriptLock: use $LogPrintExit

This commit is contained in:
Christian Hesse
2020-02-27 13:51:27 +01:00
parent ceaa83b83e
commit 3db752bc97

View File

@ -306,11 +306,12 @@
# lock script against multiple invocation
:set ScriptLock do={
:global LogPrintExit;
:local Script [ :tostr $1 ];
:if ([ / system script job print count-only where script=$Script ] > 1) do={
:log debug ("Script " . $Script . " started more than once... Aborting.");
:error "Locked."
$LogPrintExit info ("Script " . $Script . " started more than once... Aborting.") true;
}
}