diff options
author | Christian Hesse <mail@eworm.de> | 2024-04-11 13:57:11 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-04-11 14:03:43 +0200 |
commit | 5f76c245b016125f9e56d45bef381bae38731491 (patch) | |
tree | 1151346ee548e0fc32290b47d03fad15b529d019 | |
parent | 6db3355858157aceb92af47faa7937008d9cbf28 (diff) |
global-functions: $ScriptFromTerminal: check multiple invocations...
... and return false.
We can not tell which job is us... So better safe than sorry.
-rw-r--r-- | global-functions.rsc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 25c248d..abb9e22 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -931,6 +931,11 @@ :local Script [ :tostr $1 ]; :global LogPrint; + :global ScriptLock; + + :if ([ $ScriptLock $Script ] = false) do={ + :return false; + } :foreach Job in=[ /system/script/job/find where script=$Script ] do={ :set Job [ /system/script/job/get $Job ]; @@ -942,8 +947,8 @@ :return true; } } - $LogPrint debug $0 ("Script " . $Script . " NOT started from terminal."); + $LogPrint debug $0 ("Script " . $Script . " NOT started from terminal."); :return false; } |