global-functions: $ScriptLock: check if script exists

This commit is contained in:
Christian Hesse 2021-06-30 21:10:58 +02:00
parent 301ad4b3e5
commit e13e3cfe34

View file

@ -910,6 +910,10 @@
:global IfThenElse;
:global LogPrintExit2;
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
$LogPrintExit2 error $0 ("A script named '" . $Script . "' does not exist!") 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 ];