mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-23 12:24:28 +02:00
check-lte-firmware-upgrade: be more verbose
(cherry picked from commit 5aecc9f1a3
)
This commit is contained in:
parent
d21cd2271f
commit
5570258ce8
1 changed files with 8 additions and 1 deletions
|
@ -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={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue