mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-20 10:57:44 +02:00
global-functions: $CertificateDownload: add proper version in user agent
This commit is contained in:
parent
1e29eeb388
commit
196fe1b010
1 changed files with 4 additions and 3 deletions
|
@ -116,14 +116,15 @@
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
|
||||||
|
:local UserAgent ("User-Agent: Mikrotik/" . [ /system/resource/get version ] . " Fetch");
|
||||||
|
|
||||||
$LogPrintExit2 info $0 ("Downloading and importing certificate with " . \
|
$LogPrintExit2 info $0 ("Downloading and importing certificate with " . \
|
||||||
"CommonName \"" . $CommonName . "\".") false;
|
"CommonName \"" . $CommonName . "\".") false;
|
||||||
:do {
|
:do {
|
||||||
:local LocalFileName ($CommonName . ".pem");
|
:local LocalFileName ($CommonName . ".pem");
|
||||||
:local UrlFileName ([ $UrlEncode $CommonName ] . ".pem");
|
:local UrlFileName ([ $UrlEncode $CommonName ] . ".pem");
|
||||||
/tool/fetch check-certificate=yes-without-crl \
|
/tool/fetch check-certificate=yes-without-crl http-header-field=$UserAgent \
|
||||||
($ScriptUpdatesBaseUrl . "certs/" . \
|
($ScriptUpdatesBaseUrl . "certs/" . $UrlFileName . $ScriptUpdatesUrlSuffix) \
|
||||||
$UrlFileName . $ScriptUpdatesUrlSuffix) \
|
|
||||||
dst-path=$LocalFileName as-value;
|
dst-path=$LocalFileName as-value;
|
||||||
$WaitForFile $LocalFileName;
|
$WaitForFile $LocalFileName;
|
||||||
/certificate/import file-name=$LocalFileName passphrase="" as-value;
|
/certificate/import file-name=$LocalFileName passphrase="" as-value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue