Refactor start.letsencrypt.sh to correct curl command syntax and improve certificate issuance logic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
gyurix
2025-11-05 09:17:56 +01:00
parent 5c33e5fb4b
commit b92ef2e2b1

View File

@@ -55,7 +55,7 @@ create_json() {
start_letsencrypt() { start_letsencrypt() {
cd /root cd /root
if [ "$LETSENCRYPT_INSTALLED" != "true" ]; then if [ "$LETSENCRYPT_INSTALLED" != "true" ]; then
curl https://get.acme.sh | sh -s email=$EMAIL curl https://get.acme.sh | | sh -s -- --home /acme.sh/$DOMAIN email=$EMAIL
LETSENCRYPT_INSTALLED=true LETSENCRYPT_INSTALLED=true
fi fi
@@ -65,8 +65,8 @@ start_letsencrypt() {
if [ "$ISSUER" == "$SUBJECT" ]; then if [ "$ISSUER" == "$SUBJECT" ]; then
echo "Self signed certificate found" echo "Self signed certificate found"
sh /root/.acme.sh/acme.sh $L_S $EK $EHK --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 >$LOG_FILE 2>&1 sh /root/.acme.sh/acme.sh $L_S $EK $EHK --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 >$LOG_FILE 2>&1
else else sh /root/.acme.sh/acme.sh $L_S $EK $EHK --renew --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 >$LOG_FILE 2>&1
sh /root/.acme.sh/acme.sh $L_S $EK $EHK --renew --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 >$LOG_FILE 2>&1
fi fi
else else
sh /root/.acme.sh/acme.sh $L_S $EK $EHK --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 >$LOG_FILE 2>&1 sh /root/.acme.sh/acme.sh $L_S $EK $EHK --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 >$LOG_FILE 2>&1