aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-03-28 12:37:58 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-03-30 17:30:53 +0200
commit1cddf5590de5f410a0b7ec00d5323bbfe25c47a1 (patch)
tree2f169c8bafe79d4c4cabcf5663ee265c9a633b56
parent5570258ce8418d03000c863403a25a184da4d13e (diff)
check-lte-firmware-upgrade: support starting unattended firmware upgrade...
... from terminal if script is installed. (cherry picked from commit d952e7e6c703dcc949478de351e9bf622be9d319)
-rw-r--r--check-lte-firmware-upgrade12
1 files changed, 12 insertions, 0 deletions
diff --git a/check-lte-firmware-upgrade b/check-lte-firmware-upgrade
index 558afb2..d861784 100644
--- a/check-lte-firmware-upgrade
+++ b/check-lte-firmware-upgrade
@@ -32,6 +32,18 @@
:if (($Firmware->"installed") != ($Firmware->"latest")) do={
$LogPrintExit2 info $0 ("A new firmware version " . ($Firmware->"latest") . " is available for " . \
"LTE interface " . $IntName . ".") false;
+
+ :if ([ $ScriptFromTerminal $0 ] = true && \
+ [ :len [ / system script find where name="unattended-lte-firmware-upgrade" ] ] > 0) do={
+ :put ("Do you want to start unattended lte firmware upgrade for interface " . $IntName . "? [y/N]");
+ :if (([ / terminal inkey timeout=60 ] % 32) = 25) do={
+ / system script run unattended-lte-firmware-upgrade;
+ $LogPrintExit2 info $0 ("Scheduled lte firmware upgrade for interface " . $IntName . "...") true;
+ } else={
+ :put "Canceled...";
+ }
+ }
+
$SendNotification2 ({ origin=$0; \
subject=([ $SymbolForNotification "sparkles" ] . "LTE firmware upgrade"); \
message=("A new firmware version " . ($Firmware->"latest") . " is available for " . \