From 625d1dda120cda02977b9f306c108755336ab4ec Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 26 Apr 2021 16:33:41 +0200 Subject: check-routeros-update: silence check-for-updates, but be more verbose --- check-routeros-update | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check-routeros-update b/check-routeros-update index 9dcef1d..27e346a 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -46,13 +46,18 @@ $WaitFullyConnected; :error "A reboot for update is already scheduled."; } -/ system package update check-for-updates without-paging; +$LogPrintExit2 debug $0 ("Checking for updates...") false; +/ system package update check-for-updates without-paging as-value; :local Update [ / system package update get ]; :if ([ :len ($Update->"latest-version") ] = 0) do={ $LogPrintExit2 info $0 ("An empty string is not a valid version.") true; } +:if (($Update->"installed-version") = ($Update->"latest-version")) do={ + $LogPrintExit2 info $0 ("System is already up to date.") true; +} + :local NumInstalled [ $VersionToNum ($Update->"installed-version") ]; :local NumLatest [ $VersionToNum ($Update->"latest-version") ]; :local Link ("https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree"); -- cgit v1.2.3-70-g09d2