diff options
author | Christian Hesse <mail@eworm.de> | 2023-12-20 12:11:12 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-12-20 12:11:12 +0100 |
commit | 5aaa24b50737686f81bf16ec22c39f1b7a596420 (patch) | |
tree | cc816b128ebe65e0d4471dd37f2e64d2b45b69fd /capsman-download-packages.capsman.rsc | |
parent | 5fdc8d9e65a9a37377e53ceb4b15258d734e764f (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.capsman.rsc')
-rw-r--r-- | capsman-download-packages.capsman.rsc | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index 99ff052..a42edd5 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -53,29 +53,14 @@ $WaitFullyConnected; } } -: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; +: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"; "mipsbe" } do={ + :foreach Package in={ "routeros"; "wireless" } do={ + :if ([ $DownloadPackage $Package $InstalledVersion $Arch $PackagePath ] = true) do={ + :set Updated true; + } + } } } |