mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-18 15:09:33 +00:00
check-certificates: move the warning below check for key
This commit is contained in:
parent
d673f0956c
commit
0fee5cea3c
1 changed files with 4 additions and 4 deletions
|
|
@ -197,16 +197,16 @@
|
|||
fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>$CertRenewTime ];
|
||||
:local CertNewVal [ /certificate/get $CertNew ];
|
||||
|
||||
:if ([ $CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") "fetch" ] = false) do={
|
||||
$LogPrint warning $ScriptName ("The certificate chain is not available!");
|
||||
}
|
||||
|
||||
:if (($CertVal->"private-key") = true && ($CertVal->"private-key") != ($CertNewVal->"private-key")) do={
|
||||
/certificate/remove $CertNew;
|
||||
$LogPrint warning $ScriptName ("Old certificate '" . ($CertVal->"name") . "' has a private key, new certificate does not. Aborting renew.");
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ $CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") "fetch" ] = false) do={
|
||||
$LogPrint warning $ScriptName ("The certificate chain is not available!");
|
||||
}
|
||||
|
||||
/ip/service/set certificate=($CertNewVal->"name") [ find where certificate=($CertVal->"name") ];
|
||||
|
||||
/ip/ipsec/identity/set certificate=($CertNewVal->"name") [ find where certificate=($CertVal->"name") ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue