mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-certificates: just change certificates, no loop
This commit is contained in:
parent
b93d4d40bc
commit
c0b73d6e92
1 changed files with 4 additions and 12 deletions
|
@ -43,25 +43,17 @@
|
||||||
:local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];
|
:local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];
|
||||||
:local CertNameNew [ / certificate get $CertNew name ];
|
:local CertNameNew [ / certificate get $CertNew name ];
|
||||||
|
|
||||||
:foreach IpService in=[ / ip service find where certificate=$CertName ] do={
|
/ ip service set certificate=$CertNameNew [ find where certificate=$CertName ];
|
||||||
/ ip service set $IpService certificate=$CertNameNew;
|
|
||||||
}
|
|
||||||
|
|
||||||
:do {
|
:do {
|
||||||
:foreach Identity in=[ / ip ipsec identity find where certificate=$CertName ] do={
|
/ ip ipsec identity set certificate=$CertNameNew [ find where certificate=$CertName ];
|
||||||
/ ip ipsec identity set $Identity certificate=$CertNameNew;
|
/ ip ipsec identity set remote-certificate=$CertNameNew [ find where remote-certificate=$CertName ];
|
||||||
}
|
|
||||||
:foreach Identity in=[ / ip ipsec identity find where remote-certificate=$CertName ] do={
|
|
||||||
/ ip ipsec identity set $Identity remote-certificate=$CertNameNew;
|
|
||||||
}
|
|
||||||
} on-error={
|
} on-error={
|
||||||
:log debug ("Setting IPSEC certificates failed. Package 'security' not installed?");
|
:log debug ("Setting IPSEC certificates failed. Package 'security' not installed?");
|
||||||
}
|
}
|
||||||
|
|
||||||
:do {
|
:do {
|
||||||
:foreach Hotspot in=[ / ip hotspot profile find where ssl-certificate=$CertName ] do={
|
/ ip hotspot profile set ssl-certificate=$CertNameNew [ find where ssl-certificate=$CertName ];
|
||||||
/ ip hotspot profile set $Hotspot ssl-certificate=$CertNameNew;
|
|
||||||
}
|
|
||||||
} on-error={
|
} on-error={
|
||||||
:log debug ("Setting hotspot certificates failed. Package 'hotspot' not installed?");
|
:log debug ("Setting hotspot certificates failed. Package 'hotspot' not installed?");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue