mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
unattended-lte-firmware-upgrade: skip interface on missing firmware information
This commit is contained in:
parent
9c9c9f4d34
commit
464dd55bbd
1 changed files with 18 additions and 14 deletions
|
@ -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 . ".");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue