From 59ab7e6d9897ec8c7b453ae6de78eb93afcceb88 Mon Sep 17 00:00:00 2001 From: gyurix Date: Tue, 3 Feb 2026 12:12:48 +0100 Subject: [PATCH] Enhance certificate issuance logic in start.letsencrypt.sh to handle unissued domains and improve renew command flow --- start.letsencrypt.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index 3bcd726..031e553 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -65,8 +65,16 @@ start_letsencrypt() { if [ "$ISSUER" == "$SUBJECT" ]; then 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 + 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