diff options
author | Christian Hesse <mail@eworm.de> | 2019-01-02 10:45:20 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-01-02 15:02:42 +0100 |
commit | a19f15c515f69dce729326dcba8c63a4cf0b5a35 (patch) | |
tree | 415ce9832a0614cdb89adee6a402e36f108f5213 | |
parent | 472cd3d90536f9a5d892d346791292d968bd82de (diff) |
check-routeros-update: do not fail if safe-update-url return error
We still want the notification...
-rw-r--r-- | check-routeros-update | 17 |
1 files 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."; } |