global-config: dropped $ScriptUpdatesIgnore, use ignore flag in comment

This commit is contained in:
Christian Hesse 2020-07-14 16:32:17 +02:00
parent d1b6ca3d0b
commit f4d6e07dbb
6 changed files with 23 additions and 17 deletions

View file

@ -8,7 +8,7 @@
# https://git.eworm.de/cgit/routeros-scripts/about/
# expected configuration version
:global ExpectedConfigVersion 21;
:global ExpectedConfigVersion 22;
# global variables not to be changed by user
:global GlobalFunctionsReady false;
@ -529,11 +529,19 @@
}
:if ([ :len $SourceNew ] = 0 && $ScriptUpdatesFetch = true) do={
:foreach IgnoreLoop in=$ScriptUpdatesIgnore do={
:if ($IgnoreLoop = $ScriptVal->"name") do={ :set Ignore 1; }
}
:local Comment [ $ParseKeyValueStore ($ScriptVal->"comment") ];
:if ($Comment->"ignore" = true) do={ :set Ignore 1; }
:if ($Comment->"ignore" = true) do={
:set Ignore 1;
} else={
# TODO: remove at later time
:foreach IgnoreLoop in=$ScriptUpdatesIgnore do={
:if ($IgnoreLoop = $ScriptVal->"name") do={
:set Ignore 1;
$LogPrintExit info ("Migrating script " . $ScriptVal->"name" . " to ignore flag in comment.") false;
/ system script set comment="ignore" ($ScriptVal->"name");
}
}
}
:if ($Ignore = 0) do={
$LogPrintExit debug ("Fetching script from url: " . $ScriptVal->"name") false;