From e3c3f00e063621fa7161a65f30bcdadce89c0e90 Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Wed, 6 Oct 2021 05:45:14 +0000 Subject: [PATCH] Missing registered email if statement and fixing domains path also. --- start.letsencrypt.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index 066d80c..31c0773 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -6,7 +6,13 @@ start_letsencrypt() { mkdir -p /acme.sh/$DOMAIN/ ; - acme.sh --register-account -m $email --issue --standalone --keylength 4096 -d $DOMAIN --cert-file /acme.sh/$DOMAIN/cert.pem --key-file /acme.sh/$DOMAIN/key.pem --fullchain-file /acme.sh/$DOMAIN/fullchain.pem ; + acme.sh --register-account -m $email; + + if acme.sh --register-account -m $email | grep "Already registered" ; then + + acme.sh -m $email --issue --standalone --keylength 4096 -d $DOMAIN --cert-file /acme.sh/$DOMAIN/cert.pem --key-file /acme.sh/$DOMAIN/key.pem --fullchain-file /acme.sh/$DOMAIN/fullchain.pem ; + + fi #mkdir -p /acme.sh/$DOMAIN/ecc-certs ; @@ -20,6 +26,7 @@ if [ -n "$LETSENCRYPT_FILE" ] ; then start_letsencrypt; rm $LETSENCRYPT_FILE; else + cd /domains for i in `ls` ; do DOMAIN=$(jq -r .DOMAIN $i) ; if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then