Sfoglia il codice sorgente

Remove symlinks if they exist

Bob Mottram 8 anni fa
parent
commit
e41728d618
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6
    0
      src/freedombone-addcert

+ 6
- 0
src/freedombone-addcert Vedi File

@@ -231,6 +231,9 @@ function add_cert_letsencrypt {
231 231
             rm -f /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key
232 232
         fi
233 233
     fi
234
+    if [ -L /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key ]; then
235
+        rm /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key
236
+    fi
234 237
     ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/privkey.pem /etc/ssl/private/${LETSENCRYPT_HOSTNAME}.key
235 238
 
236 239
     # link the public key
@@ -241,6 +244,9 @@ function add_cert_letsencrypt {
241 244
             rm -f /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem
242 245
         fi
243 246
     fi
247
+    if [ -L /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem ]; then
248
+        rm /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem
249
+    fi
244 250
     ln -s /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/fullchain.pem /etc/ssl/certs/${LETSENCRYPT_HOSTNAME}.pem
245 251
 
246 252
     cp /etc/letsencrypt/live/${LETSENCRYPT_HOSTNAME}/fullchain.pem /etc/ssl/mycerts/${LETSENCRYPT_HOSTNAME}.pem