From e695bff6bd6ed7e6505bd75f4e1a91dff9f7d369 Mon Sep 17 00:00:00 2001 From: gyurix Date: Fri, 16 Dec 2022 13:33:19 +0000 Subject: [PATCH] Added letsencrypt server variable to choose which CA server would use for certify your domain --- start.letsencrypt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index 2b66499..4a5eb29 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -1,6 +1,7 @@ #!/bin/sh email=$EMAIL +LETSENCRYPT_SERVER=$LETSENCRYPT_SERVER sending_error_msg() { @@ -11,14 +12,14 @@ start_letsencrypt() { mkdir -p /acme.sh/$DOMAIN/ ; - /usr/local/bin/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 + /usr/local/bin/acme.sh -m $email --server $LETSENCRYPT_SERVER --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 # Check certificate issuer ISSUER=$(openssl x509 -in /acme.sh/$DOMAIN/fullchain.pem -text -noout |grep -w CN |grep Issuer | cut -d '=' -f2); SUBJECT=$(openssl x509 -in /acme.sh/$DOMAIN/fullchain.pem -text -noout |grep -w CN |grep Subject | cut -d '=' -f2); if [ "$ISSUER" == "$SUBJECT" ]; then echo "Self signed certificate found"; - /usr/local/bin/acme.sh -m $email --force --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 + /usr/local/bin/acme.sh -m $email --force --server $LETSENCRYPT_SERVER --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 }