mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user