This commit is contained in:
2023-04-16 21:38:32 +08:00
parent a0849e40ef
commit 0b6c876a0f
59 changed files with 1026 additions and 189 deletions

View File

@@ -39,32 +39,34 @@ function Usage {
function StartProc {
if [ ! -e /etc/letsencrypt/accounts ]; then
Print Register ...
Print Registering ...
certbot register --register-unsafely-without-email --agree-tos
if echo "$DOMAINS" | grep -qo '^*'; then
Print Request wildcard certificate ...
Print Requesting wildcard certificate ...
certbot certonly -q --manual \
--manual-auth-hook /etc/letsencrypt/manual-hook.sh \
-d "$DOMAINS" --preferred-challenges dns \
--server https://acme-v02.api.letsencrypt.org/directory
else
Print Request certificate ...
Print Requesting certificate ...
certbot certonly -q -n --standalone -d $DOMAINS
fi
Print Generate dhparam.pem ...
Print Generating dhparam.pem ...
openssl dhparam -out /etc/letsencrypt/dhparam.pem 2048 \
&>/var/log/letsencrypt/dhparam.out
Print Succeeded to request certificate.
else
if echo "$DOMAINS" | grep -qo '^*'; then
Print Renew wildcard certificate ...
Print Renewing wildcard certificate ...
certbot certonly --force-renewal -q --manual \
--manual-auth-hook /etc/letsencrypt/manual-hook.sh \
-d "$DOMAINS" --preferred-challenges dns \
--server https://acme-v02.api.letsencrypt.org/directory
else
Print Renew certificate ...
Print Renewing certificate ...
certbot renew -q --force-renewal
fi
Print Succeeded to renew certificate.
fi
}