aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capsman-download-packages33
1 files changed, 16 insertions, 17 deletions
diff --git a/capsman-download-packages b/capsman-download-packages
index dc68486..8b31574 100644
--- a/capsman-download-packages
+++ b/capsman-download-packages
@@ -16,24 +16,23 @@
:local "installed-version" [ / system package update get installed-version ];
:local updated false;
-:foreach package in=[ / file find where type=package name~("^" . $"package-path") ] do={
- :if ([ / file get $package package-version ] != $"installed-version") do={
- :local "package-name" [ / file get $package package-name ];
- :local "package-architecture" [ / file get $package package-architecture ];
- :if ($"package-architecture" = "mips") do={
- :set "package-architecture" "mipsbe";
- }
- :if ($"package-name" = "wireless@") do={
- :set "package-name" "wireless";
- }
- :local "package-file" ($"package-name" . "-" . $"installed-version" . "-" . $"package-architecture" . ".npk");
- $CertificateAvailable "Let's Encrypt Authority X3" "letsencrypt";
- / tool fetch mode=https check-certificate=yes-without-crl \
- ("https://upgrade.mikrotik.com/routeros/" . $"installed-version" . "/" . $"package-file") \
- dst-path=($"package-path" . "/" . $"package-file");
- :set updated true;
- / file remove $package;
+:foreach package in=[ / file find where type=package \
+ package-version!=$"installed-version" name~("^" . $"package-path") ] do={
+ :local "package-name" [ / file get $package package-name ];
+ :local "package-architecture" [ / file get $package package-architecture ];
+ :if ($"package-architecture" = "mips") do={
+ :set "package-architecture" "mipsbe";
}
+ :if ($"package-name" = "wireless@") do={
+ :set "package-name" "wireless";
+ }
+ :local "package-file" ($"package-name" . "-" . $"installed-version" . "-" . $"package-architecture" . ".npk");
+ $CertificateAvailable "Let's Encrypt Authority X3" "letsencrypt";
+ / tool fetch mode=https check-certificate=yes-without-crl \
+ ("https://upgrade.mikrotik.com/routeros/" . $"installed-version" . "/" . $"package-file") \
+ dst-path=($"package-path" . "/" . $"package-file");
+ :set updated true;
+ / file remove $package;
}
:if ($updated = true) do={