mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 16:24:25 +02:00
check-routeros-update: :do ... on-error=... -> :onerror ... do=...
This commit is contained in:
parent
1925d2847c
commit
79f681b801
1 changed files with 3 additions and 3 deletions
|
@ -141,13 +141,13 @@
|
|||
|
||||
:if ([ :len $SafeUpdateUrl ] > 0) do={
|
||||
:local Result;
|
||||
:do {
|
||||
:onerror Err {
|
||||
:set Result [ /tool/fetch check-certificate=yes-without-crl \
|
||||
($SafeUpdateUrl . $Update->"channel" . "?installed=" . $Update->"installed-version" . \
|
||||
"&latest=" . $Update->"latest-version") http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
||||
output=user as-value ];
|
||||
} on-error={
|
||||
$LogPrint warning $ScriptName ("Failed receiving safe version for " . $Update->"channel" . ".");
|
||||
} do={
|
||||
$LogPrint warning $ScriptName ("Failed receiving safe version for " . $Update->"channel" . ": " . $Err);
|
||||
}
|
||||
:if ($Result->"status" = "finished" && $Result->"data" = $Update->"latest-version") do={
|
||||
$LogPrint info $ScriptName ("Version " . $Update->"latest-version" . " is considered safe, updating...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue