Skip to content

Instantly share code, notes, and snippets.

@x0341
Forked from omerxx/certbot.sh
Created February 27, 2020 23:05
Show Gist options
  • Save x0341/e5c735f78f0bc8f0743f76f0f568c85f to your computer and use it in GitHub Desktop.
Save x0341/e5c735f78f0bc8f0743f76f0f568c85f to your computer and use it in GitHub Desktop.
# Generating let's encrypt manual cert with ease
# Usage: ./cert.sh me@company.com 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