check-routeros-update: use new script 'packages-update'

This commit is contained in:
Christian Hesse 2019-02-19 16:42:04 +01:00
parent e991c82016
commit 5f210eb1ec

View file

@ -36,14 +36,15 @@
:log warning ("Failed receiving safe version for " . $Channel . "."); :log warning ("Failed receiving safe version for " . $Channel . ".");
} }
:if ($Result->"status" = "finished" && $Result->"data" = $LatestVersion) do={ :if ($Result->"status" = "finished" && $Result->"data" = $LatestVersion) do={
:if ([ / system script print count-only where name="email-backup" ] > 0) do={
/ system script run email-backup;
}
:log info ("Version " . $LatestVersion . " is considered safe, updating..."); :log info ("Version " . $LatestVersion . " is considered safe, updating...");
$SendNotification ("RouterOS update notification") \ $SendNotification ("RouterOS update notification") \
("Version " . $LatestVersion . " is considered safe for " . $Channel . \ ("Version " . $LatestVersion . " is considered safe for " . $Channel . \
", updating on " . $Identity . "..."); ", updating on " . $Identity . "...");
:if ([ / system script print count-only where name="packages-update" ] > 0) do={
/ system script run packages-update;
} else={
/ system package update install without-paging; / system package update install without-paging;
}
:error "Waiting for system to reboot."; :error "Waiting for system to reboot.";
} }
} }