Compare commits

...

5 commits

Author SHA1 Message Date
Christian Hesse 535d2d5586 packages-update: drop RouterOS version check...
... and allow all updates again. This requires RouterOS 7.13.
2024-02-19 12:13:55 +01:00
Christian Hesse b286cb6803 netwatch-notify: do not update with record in cache
Using `:resolve` we have just one address, but chances are several
records do exist. These end up in cache, so we are happy to find them
there - no need to update then.
2024-02-19 11:03:17 +01:00
Christian Hesse 872abbea7d doc/unattended-lte-firmware-upgrade: more devices supported... 2024-02-08 21:02:06 +01:00
Christian Hesse 860acffbdb unattended-lte-firmware-upgrade: add error handling 2024-02-08 21:02:06 +01:00
Christian Hesse e83154c9c3 check-lte-firmware-upgrade: give more detailed infos on modem 2024-02-08 20:54:02 +01:00
5 changed files with 19 additions and 16 deletions

View file

@ -29,8 +29,8 @@ $ScriptLock $0;
:global Identity;
:global SentLteFirmwareUpgradeNotification;
:global CharacterReplace;
:global FormatLine;
:global IfThenElse;
:global LogPrintExit2;
:global ScriptFromTerminal;
:global SendNotification2;
@ -84,7 +84,9 @@ $ScriptLock $0;
subject=([ $SymbolForNotification "sparkles" ] . "LTE firmware upgrade"); \
message=("A new firmware version " . ($Firmware->"latest") . " is available for " . \
"LTE interface " . $IntName . " on " . $Identity . ".\n\n" . \
[ $FormatLine "Interface" [ $CharacterReplace ($Info->"manufacturer" . " " . $Info->"model") ("\"") "" ] ] . "\n" . \
[ $IfThenElse ([ :len ($Info->"manufacturer") ] > 0) ([ $FormatLine "Manufacturer" ($Info->"manufacturer") ] . "\n") ] . \
[ $IfThenElse ([ :len ($Info->"model") ] > 0) ([ $FormatLine "Model" ($Info->"model") ] . "\n") ] . \
[ $IfThenElse ([ :len ($Info->"revision") ] > 0) ([ $FormatLine "Revision" ($Info->"revision") ] . "\n") ] . \
"Firmware version:\n" . \
[ $FormatLine " Installed" ($Firmware->"installed") ] . "\n" . \
[ $FormatLine " Available" ($Firmware->"latest") ]); silent=true });

View file

@ -12,6 +12,7 @@ This script upgrades LTE firmware on compatible devices:
* R11e-LTE-US
* R11e-4G
* R11e-LTE6
* ... and more - probably what ever Mikrotik builds into their devices
A temporary scheduler is created to be independent from terminal. Thus
starting the upgrade process over the broadband connection is supported.

View file

@ -79,7 +79,8 @@ $ScriptLock $0;
:if ([ $IsDNSResolving ] = true) do={
:do {
:local Resolve [ :resolve ($HostInfo->"resolve") ];
:if ($Resolve != $HostVal->"host") do={
:if ($Resolve != $HostVal->"host" and \
[ :len [ /ip/dns/cache/find where name=($HostInfo->"resolve") data=[ :tostr ($HostVal->"host") ] ] ] = 0) do={
$LogPrintExit2 info $0 ("Name '" . $HostInfo->"resolve" . [ $IfThenElse \
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
$HostInfo->"name") "" ] . "' resolves to different address " . $Resolve . \

View file

@ -3,7 +3,7 @@
# Copyright (c) 2019-2024 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
# requires RouterOS, version=7.12
# requires RouterOS, version=7.13
#
# download packages and reboot for installation
# https://git.eworm.de/cgit/routeros-scripts/about/doc/packages-update.md
@ -53,11 +53,6 @@ $ScriptLock $0;
:local NumInstalled [ $VersionToNum ($Update->"installed-version") ];
:local NumLatest [ $VersionToNum ($Update->"latest-version") ];
:if ($NumInstalled < 0x070d0000 && $NumLatest > 0x070d0000) do={
$LogPrintExit2 error $0 ("Migration to wireless/wifi package in RouterOS " . \
($Update->"latest-version") . " is pending. Please update manually!") true;
}
:local DoDowngrade false;
:if ($NumInstalled > $NumLatest) do={
:if ([ $ScriptFromTerminal $0 ] = true) do={

View file

@ -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.");
}
}