diff options
author | Christian Hesse <mail@eworm.de> | 2022-03-28 12:31:38 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-03-30 17:30:38 +0200 |
commit | 5570258ce8418d03000c863403a25a184da4d13e (patch) | |
tree | 1c943098cf980fa07bcb5ca9cac8320773f2e593 | |
parent | d21cd2271f0032984d23e1c5b6cfe8f2ade59363 (diff) |
check-lte-firmware-upgrade: be more verbose
(cherry picked from commit 5aecc9f1a316874f9c2935b6065347223927a299)
-rw-r--r-- | check-lte-firmware-upgrade | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/check-lte-firmware-upgrade b/check-lte-firmware-upgrade index aef27fe..558afb2 100644 --- a/check-lte-firmware-upgrade +++ b/check-lte-firmware-upgrade @@ -15,6 +15,7 @@ :global CharacterReplace; :global LogPrintExit2; +:global ScriptFromTerminal; :global SendNotification2; :global SymbolForNotification; @@ -22,13 +23,15 @@ :local IntName [ / interface lte get $Interface name ]; :do { :local Firmware [ / interface lte firmware-upgrade $Interface once as-value ]; + :local Info [ / interface lte info $Interface once as-value ]; :if ($SentLteFirmwareUpgradeNotification = ($Firmware->"latest")) do={ $LogPrintExit2 debug $0 ("Already sent the LTE firmware upgrade notification for version " . \ ($Firmware->"latest") . ".") false; } else={ :if (($Firmware->"installed") != ($Firmware->"latest")) do={ - :local Info [ / interface lte info $Interface once as-value ]; + $LogPrintExit2 info $0 ("A new firmware version " . ($Firmware->"latest") . " is available for " . \ + "LTE interface " . $IntName . ".") false; $SendNotification2 ({ origin=$0; \ subject=([ $SymbolForNotification "sparkles" ] . "LTE firmware upgrade"); \ message=("A new firmware version " . ($Firmware->"latest") . " is available for " . \ @@ -37,6 +40,10 @@ "Installed: " . ($Firmware->"installed") . "\n" . \ "Available: " . ($Firmware->"latest")); silent=true }); :set SentLteFirmwareUpgradeNotification ($Firmware->"latest"); + } else={ + :if ([ $ScriptFromTerminal $0 ] = true) do={ + $LogPrintExit2 info $0 ("No firmware upgrade available for LTE interface " . $IntName . ".") false; + } } } } on-error={ |