mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-15 12:34:27 +02:00
check-certificates: do not renew if loosing private key
This commit is contained in:
parent
8e628ce11e
commit
d926c84cdb
1 changed files with 5 additions and 0 deletions
|
@ -66,6 +66,11 @@ $WaitFullyConnected;
|
|||
:if ($Cert != $CertNew) do={
|
||||
$LogPrintExit debug ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.") false;
|
||||
|
||||
:if (($CertVal->"private-key") = true && ($CertVal->"private-key") != ($CertNewVal->"private-key")) do={
|
||||
/ certificate remove $CertNew;
|
||||
$LogPrintExit warning ("Old certificate '" . ($CertVal->"name") . "' has a private key, new certificate does not. Aborting renew.") true;
|
||||
}
|
||||
|
||||
/ ip service set certificate=($CertNewVal->"name") [ find where certificate=($CertVal->"name") ];
|
||||
|
||||
:do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue