capsman-download-packages: download a default set for wifiwave2

Well, AX devices can be arm or arm64... So let's just download packages
'routeros' and 'wifiwave2' - crossing fingers... 🤞
This commit is contained in:
Christian Hesse 2023-08-07 17:16:03 +02:00
parent 3cab917a61
commit d0ab951e3f
3 changed files with 26 additions and 2 deletions

View file

@ -81,8 +81,20 @@ $WaitFullyConnected;
:set Updated true;
}
}
# NOT /interface/wifiwave2 #
# NOT /caps-man #
:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
$LogPrintExit2 info $0 ("No packages available, downloading default set.") false;
:foreach Arch in={ "arm"; "arm64" } do={
:foreach Package in={ "routeros"; "wifiwave2" } do={
:if ([ $DownloadPackage $Package $InstalledVersion $Arch $PackagePath ] = true) do={
:set Updated true;
}
}
}
}
# NOT /caps-man #
:if ($Updated = true) do={
:local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0);
:if ([ :len $Script ] > 0) do={

View file

@ -53,6 +53,17 @@ $WaitFullyConnected;
}
}
:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
$LogPrintExit2 info $0 ("No packages available, downloading default set.") false;
:foreach Arch in={ "arm"; "arm64" } do={
:foreach Package in={ "routeros"; "wifiwave2" } do={
:if ([ $DownloadPackage $Package $InstalledVersion $Arch $PackagePath ] = true) do={
:set Updated true;
}
}
}
}
:if ($Updated = true) do={
:local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0);
:if ([ :len $Script ] > 0) do={

View file

@ -42,7 +42,8 @@ Packages available in local storage in older version are downloaded
unconditionally.
If no packages are found the script tries to download missing packages for
legacy CAPsMAN by guessing from system log.
legacy CAPsMAN by guessing from system log. For `wifiwave2` a default set
of packages (`routeros` and `wifiwave2` for *arm* and *arm64*) is downloaded.
Usage and invocation
--------------------