mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptLock: use $LogPrintExit
This commit is contained in:
parent
ceaa83b83e
commit
3db752bc97
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue