aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-09-27 17:13:32 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-09-30 16:23:43 +0200
commit1776b8f50b173b49ca7ce3ab917de4493ae36ff6 (patch)
tree4abcdf1788a5c19ccabc8041a920ec66f637ea33
parentc2c72818de2cf35ea5b50eed3a505f86ed6be294 (diff)
backup-partition: give warning on lock in device-moderouteros-7.17beta2-1
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
-rw-r--r--backup-partition.rsc7
1 files changed, 7 insertions, 0 deletions
diff --git a/backup-partition.rsc b/backup-partition.rsc
index 51df454..56738ba 100644
--- a/backup-partition.rsc
+++ b/backup-partition.rsc
@@ -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 ];