From a19f15c515f69dce729326dcba8c63a4cf0b5a35 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 2 Jan 2019 10:45:20 +0100 Subject: check-routeros-update: do not fail if safe-update-url return error We still want the notification... --- check-routeros-update | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/check-routeros-update b/check-routeros-update index d51b964..7209633 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -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."; } -- cgit v1.2.3-54-g00ecf