mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptFromTerminal: check multiple invocations...
... and return false. We can not tell which job is us... So better safe than sorry.
This commit is contained in:
parent
6db3355858
commit
5f76c245b0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue