1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

capsman-download-packages: upgrade CAPs one after another with delay

This commit is contained in:
Christian Hesse
2019-02-07 11:04:15 +01:00
parent b3459ed47c
commit 4c61849483

View File

@ -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");
}
}