mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
check-certificates: check and download certificate chain
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
:global CertRenewUrl;
|
:global CertRenewUrl;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
:global CertificateAvailable
|
||||||
:global CertificateNameByCN;
|
:global CertificateNameByCN;
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
@@ -56,6 +57,8 @@
|
|||||||
:local CertNew [ / certificate find where common-name=($CertVal->"common-name") fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>3w ];
|
:local CertNew [ / certificate find where common-name=($CertVal->"common-name") fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>3w ];
|
||||||
:local CertNewVal [ / certificate get $CertNew ];
|
:local CertNewVal [ / certificate get $CertNew ];
|
||||||
|
|
||||||
|
$CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN");
|
||||||
|
|
||||||
:if ($Cert != $CertNew) do={
|
:if ($Cert != $CertNew) do={
|
||||||
$LogPrintExit debug ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.") false;
|
$LogPrintExit debug ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.") false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user