Skip to content

Commit ce03f44

Browse files
committed
check-routeros-update: use a better check for valid version
Currently the latest version in long-term branch is 0.0... And the script is sending downgrade notifications. 😝 Obviously that is not a valid version... With this changen a version has to be 7.0 and above to be considered valid.
1 parent b67b9ec commit ce03f44

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

check-routeros-update

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
5353
/system/package/update/check-for-updates without-paging as-value;
5454
:local Update [ /system/package/update/get ];
5555

56-
:if ([ :len ($Update->"latest-version") ] = 0) do={
57-
$LogPrintExit2 info $0 ("An empty string is not a valid version.") true;
58-
}
59-
6056
:if ([ $ScriptFromTerminal $0 ] = true && ($Update->"installed-version") = ($Update->"latest-version")) do={
6157
$LogPrintExit2 info $0 ("System is already up to date.") true;
6258
}
@@ -65,6 +61,10 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
6561
:local NumLatest [ $VersionToNum ($Update->"latest-version") ];
6662
:local Link ("https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree");
6763

64+
:if ($NumLatest < 117505792) do={
65+
$LogPrintExit2 info $0 ("The version '" . ($Update->"latest-version") . "' is not a valid version.") true;
66+
}
67+
6868
:if ($NumInstalled < $NumLatest) do={
6969
:if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={
7070
$LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is a patch release, updating...") false;

0 commit comments

Comments
 (0)