check-routeros-update: do not fail if safe-update-url return error

We still want the notification...
This commit is contained in:
Christian Hesse 2019-01-02 10:45:20 +01:00
parent 472cd3d905
commit a19f15c515

View file

@ -27,14 +27,19 @@
:local serialnumber [ / system routerboard get serial-number ];
:if ([ :len $"safe-update-url" ] > 0) do={
:local result [ / tool fetch check-certificate=yes-without-crl \
($"safe-update-url" . $channel . "?installed=" . $installedversion . \
"&latest=" . $latestversion) output=user as-value ];
:local result;
:do {
:set result [ / tool fetch check-certificate=yes-without-crl \
($"safe-update-url" . $channel . "?installed=" . $installedversion . \
"&latest=" . $latestversion) output=user as-value ];
} on-error={
:log debug ("Failed receiving safe version.");
}
:if ($result->"status" = "finished" && $result->"data" = $latestversion) do={
:log info ("Version " . $latestversion . " is assumed safe, updating...");
$SendNotification ("RouterOS update notification") \
("Version " . $latestversion . " is assumed safe for " . $channel . \
", updating on " . $identity . "...");
$SendNotification ("RouterOS update notification") \
("Version " . $latestversion . " is assumed safe for " . $channel . \
", updating on " . $identity . "...");
/ system package update install;
:error "Waiting for system to reboot.";
}