aboutsummaryrefslogtreecommitdiffstats
path: root/check-certificates
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-04-10 13:56:44 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-04-10 13:59:38 +0200
commitc0b73d6e92799dd7d4638863daac1deab5836747 (patch)
treecb173241a5085f56c0f48a0e6a1ddae2e5b0226b /check-certificates
parentb93d4d40bc946ac31fcdb619343e21717d816e99 (diff)
check-certificates: just change certificates, no loop
Diffstat (limited to 'check-certificates')
-rw-r--r--check-certificates16
1 files changed, 4 insertions, 12 deletions
diff --git a/check-certificates b/check-certificates
index 26f17ba..308c401 100644
--- a/check-certificates
+++ b/check-certificates
@@ -43,25 +43,17 @@
:local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];
:local CertNameNew [ / certificate get $CertNew name ];
- :foreach IpService in=[ / ip service find where certificate=$CertName ] do={
- / ip service set $IpService certificate=$CertNameNew;
- }
+ / ip service set certificate=$CertNameNew [ find where certificate=$CertName ];
:do {
- :foreach Identity in=[ / ip ipsec identity find where certificate=$CertName ] do={
- / ip ipsec identity set $Identity certificate=$CertNameNew;
- }
- :foreach Identity in=[ / ip ipsec identity find where remote-certificate=$CertName ] do={
- / ip ipsec identity set $Identity remote-certificate=$CertNameNew;
- }
+ / ip ipsec identity set certificate=$CertNameNew [ find where certificate=$CertName ];
+ / ip ipsec identity set remote-certificate=$CertNameNew [ find where remote-certificate=$CertName ];
} on-error={
:log debug ("Setting IPSEC certificates failed. Package 'security' not installed?");
}
:do {
- :foreach Hotspot in=[ / ip hotspot profile find where ssl-certificate=$CertName ] do={
- / ip hotspot profile set $Hotspot ssl-certificate=$CertNameNew;
- }
+ / ip hotspot profile set ssl-certificate=$CertNameNew [ find where ssl-certificate=$CertName ];
} on-error={
:log debug ("Setting hotspot certificates failed. Package 'hotspot' not installed?");
}