check-routeros-update: use $LogPrintExit

This commit is contained in:
Christian Hesse 2020-03-05 09:08:57 +01:00
parent 08bb73b6fc
commit 970641a974

View file

@ -48,10 +48,10 @@
($SafeUpdateUrl . $Update->"channel" . "?installed=" . $Update->"installed-version" . \ ($SafeUpdateUrl . $Update->"channel" . "?installed=" . $Update->"installed-version" . \
"&latest=" . $Update->"latest-version") output=user as-value ]; "&latest=" . $Update->"latest-version") output=user as-value ];
} on-error={ } on-error={
:log warning ("Failed receiving safe version for " . $Update->"channel" . "."); $LogPrintExit warning ("Failed receiving safe version for " . $Update->"channel" . ".") false;
} }
:if ($Result->"status" = "finished" && $Result->"data" = $Update->"latest-version") do={ :if ($Result->"status" = "finished" && $Result->"data" = $Update->"latest-version") do={
:log info ("Version " . $Update->"latest-version" . " is considered safe, updating..."); $LogPrintExit info ("Version " . $Update->"latest-version" . " is considered safe, updating...") false;
$SendNotification ("RouterOS update") \ $SendNotification ("RouterOS update") \
("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \ ("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \
", updating on " . $Identity . "...") "" "true"; ", updating on " . $Identity . "...") "" "true";
@ -69,9 +69,8 @@
} }
:if ($SentRouterosUpdateNotification = $Update->"latest-version") do={ :if ($SentRouterosUpdateNotification = $Update->"latest-version") do={
:log info ("Already sent the RouterOS update notification for version " . \ $LogPrintExit info ("Already sent the RouterOS update notification for version " . \
$Update->"latest-version" . "."); $Update->"latest-version" . ".") true;
:error "Already sent notification.";
} }
$SendNotification ("RouterOS update") \ $SendNotification ("RouterOS update") \