Enhance certificate issuance logic in start.letsencrypt.sh to handle unissued domains and improve renew command flow
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
gyurix
2026-02-03 12:12:48 +01:00
parent a7302de7e5
commit 59ab7e6d98

View File

@@ -66,7 +66,15 @@ start_letsencrypt() {
echo "Self signed certificate found"
sh /acme.sh/acme.sh $L_S $EK $EHK --issue --standalone --config-home /acme.sh --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 >$LOG_FILE 2>&1
else
VAR=""
SUCCESS=""
sh /acme.sh/acme.sh $L_S $EK $EHK --renew --standalone --config-home /acme.sh --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 >$LOG_FILE 2>&1
VAR=$(echo "'$DOMAIN' is not an issued domain, skipping")
SUCCESS=$(cat $LOG_FILE | |grep -Fi "$VAR")
if [ "$SUCCESS" != "" ]; then
sh /acme.sh/acme.sh $L_S $EK $EHK --issue --standalone --config-home /acme.sh --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 >$LOG_FILE 2>&1
fi
fi
else
sh /acme.sh/acme.sh $L_S $EK $EHK --issue --standalone --config-home /acme.sh --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 >$LOG_FILE 2>&1