From d952e7e6c703dcc949478de351e9bf622be9d319 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 28 Mar 2022 12:37:58 +0200 Subject: check-lte-firmware-upgrade: support starting unattended firmware upgrade... ... from terminal if script is installed. --- check-lte-firmware-upgrade | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'check-lte-firmware-upgrade') diff --git a/check-lte-firmware-upgrade b/check-lte-firmware-upgrade index 90de3fe..0ae239c 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 " . \ -- cgit v1.2.3-70-g09d2