mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-09 20:54:34 +02:00
global-functions: $ScriptInstallUpdate: restore indention
No functional change.
This commit is contained in:
parent
382f928568
commit
2ab3468700
1 changed files with 21 additions and 22 deletions
|
@ -888,30 +888,29 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:if (!($ScriptInfo->"ignore" = true)) do={
|
:if (!($ScriptInfo->"ignore" = true)) do={
|
||||||
:do {
|
:do {
|
||||||
:local BaseUrl $ScriptUpdatesBaseUrl;
|
:local BaseUrl $ScriptUpdatesBaseUrl;
|
||||||
:local UrlSuffix $ScriptUpdatesUrlSuffix;
|
:local UrlSuffix $ScriptUpdatesUrlSuffix;
|
||||||
:if ([ :typeof ($ScriptInfo->"base-url") ] = "str") do={ :set BaseUrl ($ScriptInfo->"base-url"); }
|
:if ([ :typeof ($ScriptInfo->"base-url") ] = "str") do={ :set BaseUrl ($ScriptInfo->"base-url"); }
|
||||||
:if ([ :typeof ($ScriptInfo->"url-suffix") ] = "str") do={ :set UrlSuffix ($ScriptInfo->"url-suffix"); }
|
:if ([ :typeof ($ScriptInfo->"url-suffix") ] = "str") do={ :set UrlSuffix ($ScriptInfo->"url-suffix"); }
|
||||||
:local Url ($BaseUrl . $ScriptVal->"name" . ".rsc" . $UrlSuffix);
|
:local Url ($BaseUrl . $ScriptVal->"name" . ".rsc" . $UrlSuffix);
|
||||||
|
$LogPrintExit2 debug $0 ("Fetching script '" . $ScriptVal->"name" . "' from url: " . $Url) false;
|
||||||
$LogPrintExit2 debug $0 ("Fetching script '" . $ScriptVal->"name" . "' from url: " . $Url) false;
|
:local Result [ /tool/fetch check-certificate=yes-without-crl \
|
||||||
:local Result [ /tool/fetch check-certificate=yes-without-crl \
|
http-header-field=({ $FetchUserAgent }) $Url output=user as-value ];
|
||||||
http-header-field=({ $FetchUserAgent }) $Url output=user as-value ];
|
:if ($Result->"status" = "finished") do={
|
||||||
:if ($Result->"status" = "finished") do={
|
:set SourceNew ($Result->"data");
|
||||||
:set SourceNew ($Result->"data");
|
}
|
||||||
}
|
} on-error={
|
||||||
} on-error={
|
:if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={
|
||||||
:if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={
|
$LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . \
|
||||||
$LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . \
|
"', removing dummy. Typo on installation?") false;
|
||||||
"', removing dummy. Typo on installation?") false;
|
/system/script/remove $Script;
|
||||||
/system/script/remove $Script;
|
} else={
|
||||||
} else={
|
$LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "'!") false;
|
||||||
$LogPrintExit2 warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "'!") false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:if ([ :len $SourceNew ] > 0) do={
|
:if ([ :len $SourceNew ] > 0) do={
|
||||||
:if ($SourceNew != $ScriptVal->"source") do={
|
:if ($SourceNew != $ScriptVal->"source") do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue