diff options
author | Christian Hesse <mail@eworm.de> | 2021-02-26 12:21:38 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-02-26 12:21:38 +0100 |
commit | 464dd55bbdc008f0e8c8ac1b8405e9dc880506c4 (patch) | |
tree | b03099d71bc59a5f06da1a96ac1e5c0e761a2199 /unattended-lte-firmware-upgrade | |
parent | 9c9c9f4d347a253ebbe1df75d3a98aeee235fa89 (diff) |
unattended-lte-firmware-upgrade: skip interface on missing firmware information
Diffstat (limited to 'unattended-lte-firmware-upgrade')
-rw-r--r-- | unattended-lte-firmware-upgrade | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/unattended-lte-firmware-upgrade b/unattended-lte-firmware-upgrade index 93638c3..0bac0a2 100644 --- a/unattended-lte-firmware-upgrade +++ b/unattended-lte-firmware-upgrade @@ -15,21 +15,25 @@ :log debug ("Could not get latest LTE firmware version for interface " . $IntName . "."); } - :if (($Firmware->"installed") != ($Firmware->"latest")) do={ - :log info ("Scheduling LTE firmware upgrade for interface " . $IntName . "."); - :global LTEFirmwareUpgrade do={ - :global LTEFirmwareUpgrade; - :set LTEFirmwareUpgrade; - / system scheduler remove ($1 . "-firmware-upgrade"); - / interface lte firmware-upgrade $1 upgrade=yes; - :log info ("LTE firmware upgrade finished, waiting for installation before reset."); - :delay 150s; - / interface lte at-chat $1 input="AT+RESET"; - :log info ("Reset device, waiting to finish and reconnect."); + :if ([ :typeof $Firmware ] = "array") do={ + :if (($Firmware->"installed") != ($Firmware->"latest")) do={ + :log info ("Scheduling LTE firmware upgrade for interface " . $IntName . "."); + :global LTEFirmwareUpgrade do={ + :global LTEFirmwareUpgrade; + :set LTEFirmwareUpgrade; + / system scheduler remove ($1 . "-firmware-upgrade"); + / interface lte firmware-upgrade $1 upgrade=yes; + :log info ("LTE firmware upgrade finished, waiting for installation before reset."); + :delay 150s; + / interface lte at-chat $1 input="AT+RESET"; + :log info ("Reset device, waiting to finish and reconnect."); + } + / system scheduler add name=($IntName . "-firmware-upgrade") start-time=startup interval=2s \ + on-event=(":global LTEFirmwareUpgrade; \$LTEFirmwareUpgrade \"" . $IntName . "\";"); + } else={ + :log info ("The LTE firmware is up to date on interface " . $IntName . "."); } - / system scheduler add name=($IntName . "-firmware-upgrade") start-time=startup interval=2s \ - on-event=(":global LTEFirmwareUpgrade; \$LTEFirmwareUpgrade \"" . $IntName . "\";"); } else={ - :log info ("The LTE firmware is up to date on interface " . $IntName . "."); + :log info ("No LTE firmware information available for interface " . $IntName . "."); } } |