mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-03 14:44:29 +02:00
packages-update: skip the interactive part of non-terminal
This commit is contained in:
parent
f26222d5a8
commit
9548641b60
1 changed files with 17 additions and 14 deletions
|
@ -5,6 +5,7 @@
|
||||||
# download packages and reboot for installation
|
# download packages and reboot for installation
|
||||||
|
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
|
:global ScriptFromTerminal;
|
||||||
|
|
||||||
:local Update [ / system package update get ];
|
:local Update [ / system package update get ];
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
/ system script run $Script;
|
/ system script run $Script;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:if ([ $ScriptFromTerminal "packages-update" ] = true) do={
|
||||||
:if (!([ /system resource get version ] ~ ($Update->"channel"))) do={
|
:if (!([ /system resource get version ] ~ ($Update->"channel"))) do={
|
||||||
:put "Update channel changed. Want to downgrade? [y/N]";
|
:put "Update channel changed. Want to downgrade? [y/N]";
|
||||||
:if ([ :terminal inkey timeout=60 ] = 121) do={
|
:if ([ :terminal inkey timeout=60 ] = 121) do={
|
||||||
|
@ -47,6 +49,7 @@
|
||||||
:log info ("Scheduled reboot for update between 03:00 and 04:00.");
|
:log info ("Scheduled reboot for update between 03:00 and 04:00.");
|
||||||
:error ("Scheduled reboot.");
|
:error ("Scheduled reboot.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:log info ("Rebooting for update.");
|
:log info ("Rebooting for update.");
|
||||||
:delay 1s;
|
:delay 1s;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue