mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
unattended-lte-firmware-upgrade: add error handling
This commit is contained in:
parent
e83154c9c3
commit
860acffbdb
1 changed files with 11 additions and 7 deletions
|
@ -24,13 +24,17 @@
|
|||
:set LTEFirmwareUpgrade;
|
||||
|
||||
/system/scheduler/remove ($1 . "-firmware-upgrade");
|
||||
/interface/lte/firmware-upgrade $1 upgrade=yes;
|
||||
:log info ("LTE firmware upgrade on '" . $1 . "' finished, waiting for reset.");
|
||||
:delay 240s;
|
||||
:local Firmware [ /interface/lte/firmware-upgrade $1 once as-value ];
|
||||
:if (($Firmware->"installed") != ($Firmware->"latest")) do={
|
||||
:log warning ("LTE firmware versions still differ. Resetting again...");
|
||||
/interface/lte/at-chat $1 input="AT+RESET";
|
||||
:do {
|
||||
/interface/lte/firmware-upgrade $1 upgrade=yes;
|
||||
:log info ("LTE firmware upgrade on '" . $1 . "' finished, waiting for reset.");
|
||||
:delay 240s;
|
||||
:local Firmware [ /interface/lte/firmware-upgrade $1 once as-value ];
|
||||
:if (($Firmware->"installed") != ($Firmware->"latest")) do={
|
||||
:log warning ("LTE firmware versions still differ. Resetting again...");
|
||||
/interface/lte/at-chat $1 input="AT+RESET";
|
||||
}
|
||||
} on-error={
|
||||
:log error ("LTE firmware upgrade on '" . $1 . "' failed.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue