Last active
October 6, 2017 19:58
-
-
Save EthraZa/5d157466a33eb97b465d9db2776c4d80 to your computer and use it in GitHub Desktop.
Issue a LetsEncrypt SSL certificate using acme.sh
This file contains 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 | |
# Issue a LetsEncrypt SSL certificate using acme.sh | |
# | |
# ISPConfig 3 preparation: | |
# Enable the SSL option and Add a self-signed certificate on SSL tab within Sites/Domains to create the needed configurations. | |
# | |
if [ -z "$*" ]; then | |
printf "\n issue-cert.sh domain.com \n\n" | |
exit 0 | |
fi | |
acme="/usr/local/acme.sh/acme.sh" | |
webroot="/usr/local/ispconfig/interface/acme" | |
webssl="/var/www/${1}/ssl" | |
sslfilename="${1}" | |
#reloadcmd="service apache2 restart" | |
reloadcmd="" | |
issueargs="--issue -d ${1} -d webmail.${1} -d www.${1} -w ${webroot}" | |
installargs="--install-cert -d ${1} --cert-file ${webssl}/${sslfilename}.crt --key-file ${webssl}/${sslfilename}.key --fullchain-file ${webssl}/${sslfilename}.bundle --reloadcmd ${reloadcmd}" | |
echo ">${acme} ${issueargs}" | |
${acme} ${issueargs} | |
echo ">${acme} ${installargs}" | |
${acme} ${installargs} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install acme.sh:
Fix crontab:
54 0 * * * /usr/local/acme.sh/acme.sh --cron --home /usr/local/acme.sh > /dev/null