Created
December 26, 2023 15:24
-
-
Save av1d/535932e5a4158c0943f16de031fcef31 to your computer and use it in GitHub Desktop.
use acme.sh to 'automatically' grab an SSL certificate and deploy it for a list of domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# use acme.sh to 'automatically' grab an SSL certificate and deploy it for a list of domains | |
# https://github.com/acmesh-official/acme.sh | |
# domains.txt contains the domain and its path, space-separated, one per line: | |
# example.com /home/luser/example.com | |
# example.org /home/luser/public_html | |
file="domains.txt" | |
# Read the file line by line | |
while read -r line; do | |
domainName=$(echo "$line" | awk '{print $1}') | |
domainPath=$(echo "$line" | awk '{print $2}') | |
./acme.sh --issue --webroot $domainPath -d $domainName --force | |
./acme.sh --deploy --deploy-hook cpanel_uapi --domain $domainName | |
done < "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment