mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $ScriptLock: check if script is running
This commit is contained in:
parent
e13e3cfe34
commit
b2d0ed1240
1 changed files with 4 additions and 0 deletions
|
@ -914,6 +914,10 @@
|
||||||
$LogPrintExit2 error $0 ("A script named '" . $Script . "' does not exist!") true;
|
$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={
|
:if ([ :len [ / system script job find where script=$Script ] ] > 1) do={
|
||||||
$LogPrintExit2 info $0 ("Script " . $Script . " started more than once... Aborting.") \
|
$LogPrintExit2 info $0 ("Script " . $Script . " started more than once... Aborting.") \
|
||||||
[ $IfThenElse ($DoReturn = true) false true ];
|
[ $IfThenElse ($DoReturn = true) false true ];
|
||||||
|
|
Loading…
Reference in a new issue