mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-16 13:04:30 +02:00
global-functions: $ScriptLock: check if script exists
This commit is contained in:
parent
301ad4b3e5
commit
e13e3cfe34
1 changed files with 4 additions and 0 deletions
|
@ -910,6 +910,10 @@
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
|
||||||
|
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
||||||
|
$LogPrintExit2 error $0 ("A script named '" . $Script . "' does not exist!") 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…
Add table
Add a link
Reference in a new issue