aboutsummaryrefslogtreecommitdiffstats
path: root/check-routeros-update
diff options
context:
space:
mode:
Diffstat (limited to 'check-routeros-update')
-rw-r--r--check-routeros-update7
1 files changed, 6 insertions, 1 deletions
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");