aboutsummaryrefslogtreecommitdiffstats
path: root/capsman-download-packages
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-02-07 11:04:15 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-02-07 11:04:15 +0100
commit4c618494837bb6df1e95cbdfe6d2672aea3fecd4 (patch)
treee54b0a910203fdb058759e04fbc75a9fd719ee61 /capsman-download-packages
parentb3459ed47ca3d8475aeb5744cfe39c88f0befa51 (diff)
capsman-download-packages: upgrade CAPs one after another with delay
Diffstat (limited to 'capsman-download-packages')
-rw-r--r--capsman-download-packages11
1 files changed, 9 insertions, 2 deletions
diff --git a/capsman-download-packages b/capsman-download-packages
index babea59..b77b891 100644
--- a/capsman-download-packages
+++ b/capsman-download-packages
@@ -32,6 +32,13 @@
}
}
-:if ($Updated = true) do={
- / caps-man remote-cap upgrade [ find where version!=$InstalledVersion ];
+:local RemoteCapCount [ /caps-man remote-cap print count-only ];
+:if ($Updated = true && $RemoteCapCount > 0) do={
+ :local Delay (600 / $RemoteCapCount);
+ :if ($Delay > 120) do={ :set Delay 120; }
+ :foreach RemoteCap in=[ / caps-man remote-cap find where version!=$InstalledVersion ] do={
+ :log debug ("Starting upgrade for CAP " . [ / caps-man remote-cap get $RemoteCap name ] . "...");
+ / caps-man remote-cap upgrade $RemoteCap;
+ :delay ($Delay . "s");
+ }
}