mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-18 00:28:28 +02:00
global-functions: $ScriptInstallUpdate: resolve more nested conditions
Just like the previous one.
This commit is contained in:
parent
8b19e74736
commit
414c83ef81
1 changed files with 17 additions and 11 deletions
|
@ -1221,18 +1221,24 @@
|
||||||
:if ([ :len $GlobalConfigMigration ] > 0) do={
|
:if ([ :len $GlobalConfigMigration ] > 0) do={
|
||||||
:for I from=($ExpectedConfigVersionBefore + 1) to=$ExpectedConfigVersion do={
|
:for I from=($ExpectedConfigVersionBefore + 1) to=$ExpectedConfigVersion do={
|
||||||
:local Migration ($GlobalConfigMigration->[ :tostr $I ]);
|
:local Migration ($GlobalConfigMigration->[ :tostr $I ]);
|
||||||
:if ([ :typeof $Migration ] = "str") do={
|
:do {
|
||||||
:if ([ $ValidateSyntax $Migration ] = true) do={
|
:if ([ :typeof $Migration ] != "str") do={
|
||||||
$LogPrint info $0 ("Applying migration for change " . $I . ": " . $Migration);
|
$LogPrint debug $0 ("Migration code for change " . $I . " is not available.");
|
||||||
:do {
|
:error false;
|
||||||
[ :parse $Migration ];
|
|
||||||
} on-error={
|
|
||||||
$LogPrint warning $0 ("Migration code for change " . $I . " failed to run!");
|
|
||||||
}
|
|
||||||
} else={
|
|
||||||
$LogPrint warning $0 ("Migration code for change " . $I . " failed syntax validation!");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
:if ([ $ValidateSyntax $Migration ] = false) do={
|
||||||
|
$LogPrint warning $0 ("Migration code for change " . $I . " failed syntax validation!");
|
||||||
|
:error false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$LogPrint info $0 ("Applying migration for change " . $I . ": " . $Migration);
|
||||||
|
:do {
|
||||||
|
[ :parse $Migration ];
|
||||||
|
} on-error={
|
||||||
|
$LogPrint warning $0 ("Migration code for change " . $I . " failed to run!");
|
||||||
|
}
|
||||||
|
} on-error={ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue