From 29bcd191ee7b4487cb9c909e6c7778767c6283f8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 17 Apr 2025 10:44:05 +0200 Subject: [PATCH] global-functions: $ScriptInstallUpdate: support downloading certificate... ... for individual scripts. Just add it in comment with "certificate=...". This also works on installtion: $ScriptInstallUpdate new-script "base-url=..., certificate=..."; Closes: https://github.com/eworm-de/routeros-scripts/pull/97 --- global-functions.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 70269c8..72c36cd 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1195,6 +1195,12 @@ :error true; } + :if ([ :len ($ScriptInfo->"certificate") ] > 0) do={ + :if ([ $CertificateAvailable ($ScriptInfo->"certificate") ] = false) do={ + $LogPrint warning $0 ("Downloading certificate failed, trying without."); + } + } + :do { :local BaseUrl [ $EitherOr ($ScriptInfo->"base-url") $ScriptUpdatesBaseUrl ]; :local UrlSuffix [ $EitherOr ($ScriptInfo->"url-suffix") $ScriptUpdatesUrlSuffix ];