mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-27 14:24:50 +02: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
1 changed files with 6 additions and 1 deletions
|
@ -931,6 +931,11 @@
|
||||||
:local Script [ :tostr $1 ];
|
:local Script [ :tostr $1 ];
|
||||||
|
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
|
:global ScriptLock;
|
||||||
|
|
||||||
|
:if ([ $ScriptLock $Script ] = false) do={
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
|
||||||
:foreach Job in=[ /system/script/job/find where script=$Script ] do={
|
:foreach Job in=[ /system/script/job/find where script=$Script ] do={
|
||||||
:set Job [ /system/script/job/get $Job ];
|
:set Job [ /system/script/job/get $Job ];
|
||||||
|
@ -942,8 +947,8 @@
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$LogPrint debug $0 ("Script " . $Script . " NOT started from terminal.");
|
|
||||||
|
|
||||||
|
$LogPrint debug $0 ("Script " . $Script . " NOT started from terminal.");
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue