diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index b3d9925..6c48d78 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -24,8 +24,13 @@ if [ -n "$LETSENCRYPT_FILE" ] ; then else for i in `ls` ; do DOMAIN=$(jq -r .DOMAIN $i) ; - start_letsencrypt; - touch /acme.sh/$DOMAIN/new_certificate + if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then + start_letsencrypt ; + touch /acme.sh/$DOMAIN/renew_certificate; + else + start_letsencrypt; + touch /acme.sh/$DOMAIN/new_certificate; + fi done ; fi