mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-22 13:09:37 +00:00
Compare commits
7 commits
fa16e79746
...
460508c931
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
460508c931 | ||
|
|
6aebf5720d | ||
|
|
22c3f70dab | ||
|
|
0d5ee6cf23 | ||
|
|
491189ece4 | ||
|
|
538071631d | ||
|
|
76ae9686cf |
5 changed files with 13 additions and 9 deletions
|
|
@ -16,7 +16,7 @@ DOMAINS_DUAL = \
|
||||||
gitlab.com/USERTrust-RSA-Certification-Authority \
|
gitlab.com/USERTrust-RSA-Certification-Authority \
|
||||||
lists.blocklist.de/GTS-Root-R4 \
|
lists.blocklist.de/GTS-Root-R4 \
|
||||||
matrix.org/GTS-Root-R4 \
|
matrix.org/GTS-Root-R4 \
|
||||||
raw.githubusercontent.com/USERTrust-RSA-Certification-Authority \
|
raw.githubusercontent.com/ISRG-Root-X1 \
|
||||||
rsc.eworm.de/Root-YE \
|
rsc.eworm.de/Root-YE \
|
||||||
upgrade.mikrotik.com/ISRG-Root-X1
|
upgrade.mikrotik.com/ISRG-Root-X1
|
||||||
DOMAINS_IPV4 = \
|
DOMAINS_IPV4 = \
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@
|
||||||
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
||||||
($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value;
|
($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value;
|
||||||
} do={
|
} do={
|
||||||
:if ($Err != "Fetch failed with status 404") do={
|
:if (!($Err ~ "[Ss]tatus 404")) do={
|
||||||
$LogPrint warning $0 ("Failed fetching certificate: " . $Err);
|
$LogPrint warning $0 ("Failed fetching certificate by '" . $FetchName . "': " . $Err);
|
||||||
}
|
}
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
|
@ -177,9 +177,11 @@
|
||||||
$LogPrint info $ScriptName ("Attempting to renew certificate '" . ($CertVal->"name") . "'.");
|
$LogPrint info $ScriptName ("Attempting to renew certificate '" . ($CertVal->"name") . "'.");
|
||||||
|
|
||||||
:local ImportSuccess false;
|
:local ImportSuccess false;
|
||||||
:set LastName ($CertVal->"common-name");
|
:if ([ :len ($CertVal->"common-name") ] > 0) do={
|
||||||
:set FetchName $LastName;
|
:set LastName ($CertVal->"common-name");
|
||||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ];
|
:set FetchName $LastName;
|
||||||
|
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ];
|
||||||
|
}
|
||||||
:foreach SAN in=($CertVal->"subject-alt-name") do={
|
:foreach SAN in=($CertVal->"subject-alt-name") do={
|
||||||
:if ($ImportSuccess = false) do={
|
:if ($ImportSuccess = false) do={
|
||||||
:set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ];
|
:set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ];
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ Given you have a certificate on you server, you can use `check-certificates`
|
||||||
for the initial import. Just create a *dummy* certificate with short lifetime
|
for the initial import. Just create a *dummy* certificate with short lifetime
|
||||||
that matches criteria to be renewed:
|
that matches criteria to be renewed:
|
||||||
|
|
||||||
/certificate/add name=example.com common-name=example.com days-valid=1;
|
/certificate/add name="example.com" common-name="example.com" subject-alt-name="DNS:example.com" days-valid=1;
|
||||||
/certificate/sign example.com;
|
/certificate/sign example.com;
|
||||||
/system/script/run check-certificates;
|
/system/script/run check-certificates;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
# cert="Root YE" };
|
# cert="Root YE" };
|
||||||
{ url="https://raw.githubusercontent.com/stamparm/ipsum/refs/heads/master/levels/4.txt";
|
{ url="https://raw.githubusercontent.com/stamparm/ipsum/refs/heads/master/levels/4.txt";
|
||||||
# # higher level (decrease the numerical value) for more addresses, and vice versa
|
# # higher level (decrease the numerical value) for more addresses, and vice versa
|
||||||
cert="USERTrust RSA Certification Authority" };
|
cert="ISRG Root X1" };
|
||||||
{ url="https://www.dshield.org/block.txt"; cidr="/24";
|
{ url="https://www.dshield.org/block.txt"; cidr="/24";
|
||||||
cert="GTS Root R4" };
|
cert="GTS Root R4" };
|
||||||
{ url="https://lists.blocklist.de/lists/strongips.txt";
|
{ url="https://lists.blocklist.de/lists/strongips.txt";
|
||||||
|
|
|
||||||
|
|
@ -1290,7 +1290,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Script in=$Scripts do={
|
:foreach Script in=$Scripts do={
|
||||||
:if ([ :len [ /system/script/find where name=$Script ] ] = 0) do={
|
:if ([ :len [ /system/script/find where name=$Script ] ] > 0) do={
|
||||||
|
$LogPrint warning $0 ("Requested to add script '" . $Script . "', but that exists already!");
|
||||||
|
} else={
|
||||||
$LogPrint info $0 ("Adding new script: " . $Script);
|
$LogPrint info $0 ("Adding new script: " . $Script);
|
||||||
/system/script/add name=$Script owner=$Script source="#!rsc by RouterOS\n" comment=$NewComment;
|
/system/script/add name=$Script owner=$Script source="#!rsc by RouterOS\n" comment=$NewComment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue