From 0a72fa029f4f00e15ef9c8457fdce3fe930d28cc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 12 Dec 2015 09:54:04 +0000 Subject: [PATCH] Remove any previous private key when adding letsencrypt cert --- src/freedombone-addcert | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/freedombone-addcert b/src/freedombone-addcert index b8c5fa32..8212446d 100755 --- a/src/freedombone-addcert +++ b/src/freedombone-addcert @@ -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