mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 12:54:28 +02:00
packages-update: give warning on lock in device-mode
RouterOS 7.17beta2 introduced some extra security measures, including some to prevent downgrade attacks for the installation. Detect early and exit with message and error. https://help.mikrotik.com/docs/display/ROS/Device-mode
This commit is contained in:
parent
1776b8f50b
commit
f2576cf558
1 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
:global Grep;
|
||||
:global LogPrint;
|
||||
:global ParseKeyValueStore;
|
||||
:global RequiredRouterOS;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global VersionToNum;
|
||||
|
@ -99,6 +100,13 @@
|
|||
|
||||
:local DoDowngrade false;
|
||||
:if ($NumInstalled > $NumLatest) do={
|
||||
:if ([ $RequiredRouterOS $ScriptName "7.17beta2" false ] = true && \
|
||||
([ /system/device-mode/get ]->"downgrade") != true) do={
|
||||
$LogPrint error $ScriptName \
|
||||
("The device mode has locked downgrades! You will need physical access!");
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
|
||||
:put "Latest version is older than installed one. Want to downgrade? [y/N]";
|
||||
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue