From d0ab951e3fbc2b4a82671e6844389068ef377549 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 7 Aug 2023 17:16:03 +0200 Subject: capsman-download-packages: download a default set for wifiwave2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Well, AX devices can be arm or arm64... So let's just download packages 'routeros' and 'wifiwave2' - crossing fingers... 🤞 --- capsman-download-packages.template.rsc | 14 +++++++++++++- capsman-download-packages.wifiwave2.rsc | 11 +++++++++++ doc/capsman-download-packages.md | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index 4b52569..71bced0 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -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={ diff --git a/capsman-download-packages.wifiwave2.rsc b/capsman-download-packages.wifiwave2.rsc index af8b8e5..6a12b2d 100644 --- a/capsman-download-packages.wifiwave2.rsc +++ b/capsman-download-packages.wifiwave2.rsc @@ -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={ diff --git a/doc/capsman-download-packages.md b/doc/capsman-download-packages.md index d9c76c0..8174c13 100644 --- a/doc/capsman-download-packages.md +++ b/doc/capsman-download-packages.md @@ -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 -------------------- -- cgit v1.2.3-70-g09d2