Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Bash script to retrieve letsencrypt certificates using the certbot/certbot docker image.
- # Specify variables for retrieving the certs
- DIRECTORY="/root/certs"
- DOMAIN="REDACTED"
- # Make sure the certificate directory exists
- if [ ! -d "$DIRECTORY" ]; then
- mkdir -p $DIRECTORY
- fi
- # Retrieve certificates. Please note that both porth 80 and 443 have to be available for this to work!
- docker run --rm -it -v $DIRECTORY:/etc/letsencrypt -p 443:443 -p 80:80 certbot/certbot certonly --authenticator standalone -d $DOMAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement