aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-06-30 21:18:38 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-06-30 21:18:38 +0200
commitb2d0ed1240e5ae5a0e48dfd706e8496e6492fd10 (patch)
treedcc90ce22efb26f119fc0b394c66e99b72f6fa1b
parente13e3cfe34b2ac0c1ec859d05ba2d0df8adc2e0f (diff)
global-functions: $ScriptLock: check if script is running
-rw-r--r--global-functions4
1 files changed, 4 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index 7b68701..255c30a 100644
--- a/global-functions
+++ b/global-functions
@@ -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 ];