mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-routeros-update: allow interactive update from terminal
This commit is contained in:
parent
04025da9b8
commit
4c28e9f9c2
1 changed files with 19 additions and 6 deletions
|
@ -10,6 +10,15 @@
|
||||||
|
|
||||||
:global SendNotification;
|
:global SendNotification;
|
||||||
|
|
||||||
|
:local Update do={
|
||||||
|
:if ([ / system script print count-only where name="packages-update" ] > 0) do={
|
||||||
|
/ system script run packages-update;
|
||||||
|
} else={
|
||||||
|
/ system package update install without-paging;
|
||||||
|
}
|
||||||
|
:error "Waiting for system to reboot.";
|
||||||
|
}
|
||||||
|
|
||||||
:if ([ / system package print count-only where name="wireless" disabled=no ] > 0) do={
|
:if ([ / system package print count-only where name="wireless" disabled=no ] > 0) do={
|
||||||
:if ([ / interface wireless cap get enabled ] = true && \
|
:if ([ / interface wireless cap get enabled ] = true && \
|
||||||
[ / caps-man manager get enabled ] = false) do={
|
[ / caps-man manager get enabled ] = false) do={
|
||||||
|
@ -41,12 +50,16 @@
|
||||||
$SendNotification ("RouterOS update notification") \
|
$SendNotification ("RouterOS update notification") \
|
||||||
("Version " . $LatestVersion . " is considered safe for " . $Channel . \
|
("Version " . $LatestVersion . " is considered safe for " . $Channel . \
|
||||||
", updating on " . $Identity . "...");
|
", updating on " . $Identity . "...");
|
||||||
:if ([ / system script print count-only where name="packages-update" ] > 0) do={
|
$Update;
|
||||||
/ system script run packages-update;
|
}
|
||||||
} else={
|
}
|
||||||
/ system package update install without-paging;
|
|
||||||
}
|
:if ([ / system script job print count-only where script="check-routeros-update" parent~"." ] > 0) do={
|
||||||
:error "Waiting for system to reboot.";
|
:put ("Do you want to install RouterOS version " . $LatestVersion . "? (y/n)");
|
||||||
|
:if ([ :terminal inkey timeout=60 ] = 121) do={
|
||||||
|
$Update;
|
||||||
|
} else={
|
||||||
|
:put "Canceled...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue