mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-routeros-update: do not fail if safe-update-url return error
We still want the notification...
This commit is contained in:
parent
472cd3d905
commit
a19f15c515
1 changed files with 11 additions and 6 deletions
|
@ -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.";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue