Skip to content

Commit 3fd9dd1

Browse files
committed
fix certbot symlink creation when certificate files exist
1 parent f973496 commit 3fd9dd1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

install/lib/installer_base.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,6 +3133,12 @@ public function make_ispconfig_ssl_cert() {
31333133
// certbot returns with 0 on issue for already existing certificate
31343134

31353135
$acme_cert_dir = '/etc/letsencrypt/live/' . $hostname;
3136+
foreach (array( 'fullchain.pem', 'privkey.pem' ) as $f) {
3137+
$f = $acme_cert_dir . '/' . $f;
3138+
if (file_exists($f) && ! is_link($f)) {
3139+
unlink($f);
3140+
}
3141+
}
31363142
symlink($acme_cert_dir . '/fullchain.pem', $ssl_crt_file);
31373143
symlink($acme_cert_dir . '/privkey.pem', $ssl_key_file);
31383144

0 commit comments

Comments
 (0)