Compare commits

...

2 commits

Author SHA1 Message Date
Christian Hesse
b78df91b23 README: and another hint on RouterOS version 2025-04-17 22:22:05 +02:00
Christian Hesse
29bcd191ee 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
2025-04-17 10:48:45 +02:00
2 changed files with 9 additions and 0 deletions

View file

@ -122,6 +122,9 @@ And finally load configuration and functions and add the scheduler.
![screenshot: run and schedule scripts](README.d/05-run-and-schedule-scripts.avif)
> 💡️ **Hint**: You see complaints regarding syntax errors? Most likely the
> RouterOS on your device is too old. Check for updates!
### Scheduled automatic updates
The last step is optional: Add this scheduler **only** if you want the

View file

@ -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 ];