Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Bash script to retrieve letsencrypt certificates using the certbot/certbot docker image.
  4.  
  5. # Specify variables for retrieving the certs
  6. DIRECTORY="/root/certs"
  7. DOMAIN="REDACTED"
  8.  
  9. # Make sure the certificate directory exists
  10. if [ ! -d "$DIRECTORY" ]; then
  11. mkdir -p $DIRECTORY
  12. fi
  13.  
  14. # Retrieve certificates. Please note that both porth 80 and 443 have to be available for this to work!
  15. 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