aboutsummaryrefslogtreecommitdiffstats
path: root/capsman-download-packages
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-12-28 19:30:15 +0100
committerGravatar Christian Hesse <mail@eworm.de>2018-12-28 22:56:07 +0100
commitac2e6cfc618fa1e955dcdd49ce1ee6a86cac5b6e (patch)
tree2fb1e5b709364627306bce8aa637b2b683240526 /capsman-download-packages
parent30166cc2875a9b1ca1229ee9892f37234cc43418 (diff)
global-functions: add $DownloadPackage
... and make script 'capsman-download-packages' use it.
Diffstat (limited to 'capsman-download-packages')
-rw-r--r--capsman-download-packages13
1 files changed, 5 insertions, 8 deletions
diff --git a/capsman-download-packages b/capsman-download-packages
index 8b31574..d8c3e52 100644
--- a/capsman-download-packages
+++ b/capsman-download-packages
@@ -7,7 +7,7 @@
#
# download and cleanup packages for CAP installation from CAPsMAN
-:global CertificateAvailable;
+:global DownloadPackage;
:local "package-path" [ / caps-man manager get package-path ];
:if ([ :pick $"package-path" 0 ] = "/") do={
@@ -26,13 +26,10 @@
: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 ([ $DownloadPackage $"package-name" $"installed-version" $"package-architecture" $"package-path" ] = true) do={
+ :set updated true;
+ / file remove $package;
+ }
}
:if ($updated = true) do={