aboutsummaryrefslogtreecommitdiffstats
path: root/capsman-download-packages.template.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-12-20 12:11:12 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-12-20 12:11:12 +0100
commit5aaa24b50737686f81bf16ec22c39f1b7a596420 (patch)
treecc816b128ebe65e0d4471dd37f2e64d2b45b69fd /capsman-download-packages.template.rsc
parent5fdc8d9e65a9a37377e53ceb4b15258d734e764f (diff)
capsman-download-packages: use default set for legacy capsman...
... as well - now that 'wireless' package has been split from 'routeros' guessing kind of broke. It required several attempts and intermittent errors in logs to get things right.
Diffstat (limited to 'capsman-download-packages.template.rsc')
-rw-r--r--capsman-download-packages.template.rsc35
1 files changed, 6 insertions, 29 deletions
diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc
index 7b37c36..299c2fc 100644
--- a/capsman-download-packages.template.rsc
+++ b/capsman-download-packages.template.rsc
@@ -56,38 +56,15 @@ $WaitFullyConnected;
}
}
+:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
+ $LogPrintExit2 info $0 ("No packages available, downloading default set.") false;
# NOT /interface/wifi/ #
# NOT /interface/wifiwave2/ #
-:if ([ :len [ /system/logging/find where topics~"error" !(topics~"!error") \
- !(topics~"!caps") action=memory !disabled !invalid ] ] < 1) do={
- $LogPrintExit2 warning $0 ("Looks like error messages for 'caps' are not sent to memory. " . \
- "Probably can not download packages automatically.") false;
-} else={
- :if ($Updated = false && [ /system/resource/get uptime ] < 2m) do={
- $LogPrintExit2 info $0 ("No packages downloaded, yet. Delaying for logs.") false;
- :delay 2m;
- }
-}
-
-:foreach Log in=[ /log/find where topics=({"caps"; "error"}) \
- message~("upgrade status: failed, failed to download file '.*-" . $InstalledVersion . \
- "-.*\\.npk', no such file") ] do={
- :local Message [ /log/get $Log message ];
- :local Package [ :pick $Message \
- ([ :find $Message "'" ] + 1) \
- [ :find $Message ("-" . $InstalledVersion . "-") ] ];
- :local Arch [ :pick $Message \
- ([ :find $Message ("-" . $InstalledVersion . "-") ] + 2 + [ :len $InstalledVersion ]) \
- [ :find $Message ".npk" ] ];
- :if ([ $DownloadPackage $Package $InstalledVersion $Arch $PackagePath ] = true) do={
- :set Updated true;
- }
-}
-# NOT /interface/wifiwave2/ #
+ :foreach Arch in={ "arm"; "mipsbe" } do={
+ :foreach Package in={ "routeros"; "wireless" } do={
# NOT /interface/wifi/ #
+# 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={
# NOT /interface/wifi/ #
:foreach Package in={ "routeros"; "wifiwave2" } do={
@@ -95,13 +72,13 @@ $WaitFullyConnected;
# NOT /interface/wifiwave2/ #
:foreach Package in={ "routeros"; "wifi-qcom"; "wifi-qcom-ac" } do={
# NOT /interface/wifiwave2/ #
+# NOT /caps-man/ #
: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);