aboutsummaryrefslogtreecommitdiffstats
path: root/firmware-upgrade-reboot
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-03-08 22:47:26 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-03-08 22:47:26 +0100
commit122f90b6930ba499f917887b6e25adae3109a513 (patch)
treee3c78e07ac96aa688cca08d2e28a9b195340fd3f /firmware-upgrade-reboot
parentcbb2f067e64d09d3d1443d9c2b17266fa56b2e99 (diff)
firmware-upgrade-reboot: ignore firmware downgrade
Diffstat (limited to 'firmware-upgrade-reboot')
-rw-r--r--firmware-upgrade-reboot4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware-upgrade-reboot b/firmware-upgrade-reboot
index a3a25db..ac2cb55 100644
--- a/firmware-upgrade-reboot
+++ b/firmware-upgrade-reboot
@@ -11,11 +11,15 @@
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global LogPrintExit2;
+:global VersionToNum;
:local RouterBoard [ / system routerboard get ];
:if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={
$LogPrintExit2 info $0 ("Firmware is already up to date.") true;
}
+:if ([ $VersionToNum ($RouterBoard->"current-firmware") ] > [ $VersionToNum ($RouterBoard->"upgrade-firmware") ]) do={
+ $LogPrintExit2 info $0 ("Different firmware version is available, but it is a downgrade. Ignoring.") true;
+}
:if ([ / system routerboard settings get auto-upgrade ] = false) do={
$LogPrintExit2 info $0 ("Firmware version " . $RouterBoard->"upgrade-firmware" . \