global-functions: $ScriptLock: check if script is running

This commit is contained in:
Christian Hesse 2021-06-30 21:18:38 +02:00
parent e13e3cfe34
commit b2d0ed1240

View file

@ -914,6 +914,10 @@
$LogPrintExit2 error $0 ("A script named '" . $Script . "' does not exist!") true;
}
:if ([ :len [ / system script job find where script=$Script ] ] = 0) do={
$LogPrintExit2 error $0 ("No script '" . $Script . "' is running!") true;
}
:if ([ :len [ / system script job find where script=$Script ] ] > 1) do={
$LogPrintExit2 info $0 ("Script " . $Script . " started more than once... Aborting.") \
[ $IfThenElse ($DoReturn = true) false true ];