Remove any previous private key when adding letsencrypt cert
This commit is contained in:
parent
1951eafc40
commit
0a72fa029f
|
@ -192,6 +192,8 @@ if [ $LETSENCRYPT_HOSTNAME ]; then
|
|||
if [ -f /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key ]; then
|
||||
if [ ! -f /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key.old ]; then
|
||||
mv /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key.old
|
||||
else
|
||||
rm -f /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key
|
||||
fi
|
||||
fi
|
||||
ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/privkey.pem /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key
|
||||
|
@ -200,6 +202,8 @@ if [ $LETSENCRYPT_HOSTNAME ]; then
|
|||
if [ -f /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem ]; then
|
||||
if [ ! -f /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem.old ]; then
|
||||
mv /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem.old
|
||||
else
|
||||
rm -f /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem
|
||||
fi
|
||||
fi
|
||||
ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/fullchain.pem /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem
|
||||
|
|
Loading…
Reference in New Issue