backup-partition: give warning on lock in device-mode

RouterOS 7.17beta2 introduced some extra security measures, including
some to prevent downgrade attacks for the installation. Thus switching
partitions (which can hold quite old installations) is denied by
device-mode now by default. Warn about that...

https://help.mikrotik.com/docs/display/ROS/Device-mode
This commit is contained in:
Christian Hesse 2024-09-27 17:13:32 +02:00
parent c2c72818de
commit 1776b8f50b

View file

@ -19,6 +19,7 @@
:global PackagesUpdateBackupFailure;
:global LogPrint;
:global RequiredRouterOS;
:global ScriptFromTerminal;
:global ScriptLock;
:global VersionToNum;
@ -59,6 +60,12 @@
:error false;
}
:if ([ $RequiredRouterOS $ScriptName "7.17beta2" false ] = true && \
([ /system/device-mode/get ]->"partitions") != true) do={
$LogPrint warning $ScriptName \
("The device mode has locked switching partitions! You will need physical access!");
}
:local FallbackToName [ /partitions/get $ActiveRunning fallback-to ];
:local FallbackTo [ /partition/find where name=$FallbackToName !active ];