mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-01 13:44:26 +02:00
mod/scriptrunonce: resolve nested conditions
This commit is contained in:
parent
b7b3b43f3b
commit
1c957dbc6d
1 changed files with 10 additions and 11 deletions
|
@ -36,17 +36,16 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $Source ] > 0) do={
|
||||
:if ([ $ValidateSyntax $Source ] = true) do={
|
||||
:do {
|
||||
$LogPrint info $0 ("Running script '" . $Script . "' now.");
|
||||
[ :parse $Source ];
|
||||
} on-error={
|
||||
$LogPrint warning $0 ("The script '" . $Script . "' failed to run!");
|
||||
}
|
||||
} else={
|
||||
$LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!");
|
||||
}
|
||||
:if ([ $ValidateSyntax $Source ] = false) do={
|
||||
$LogPrint warning $0 ("The script '" . $Script . "' failed syntax validation!");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:do {
|
||||
$LogPrint info $0 ("Running script '" . $Script . "' now.");
|
||||
[ :parse $Source ];
|
||||
} on-error={
|
||||
$LogPrint warning $0 ("The script '" . $Script . "' failed to run!");
|
||||
}
|
||||
}
|
||||
} on-error={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue