diff --git a/src/freedombone-addcert b/src/freedombone-addcert index e49492c6..f606677a 100755 --- a/src/freedombone-addcert +++ b/src/freedombone-addcert @@ -231,6 +231,9 @@ function add_cert_letsencrypt { rm -f /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key fi fi + if [ -L /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key ]; then + rm /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key + fi ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/privkey.pem /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key # link the public key @@ -241,6 +244,9 @@ function add_cert_letsencrypt { rm -f /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem fi fi + if [ -L /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem ]; then + rm /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem + fi ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/fullchain.pem /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem cp /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/fullchain.pem /etc/ssl/mycerts/${LETSENCRYPT_HOSTNAME}.pem