Last active
February 26, 2021 14:12
-
-
Save omerxx/d1056ea04b7261e62f522097f55e2a89 to your computer and use it in GitHub Desktop.
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
# Generating let's encrypt manual cert with ease | |
# Usage: ./cert.sh [email protected] my.domain.com | |
# Output: ~/certbot/.certbot/config | |
# | |
generate_certificate() { | |
email=$1 | |
domain=$2 | |
sudo docker run -it --rm -v ~/certbot:/home/root \ | |
certbot/certbot certonly --config-dir /home/root/.certbot/config \ | |
--logs-dir /home/root/.certbot/logs \ | |
--work-dir /homr/root/.certbot/work \ | |
--manual \ | |
--preferred-challenges=dns \ | |
--email="${email}" \ | |
--server https://acme-v02.api.letsencrypt.org/directory \ | |
--agree-tos -d "${domain}" | |
} | |
main() { | |
email=$1 | |
domain=$2 | |
generate_certificate "$1" "$2" | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment