Skip to content

Instantly share code, notes, and snippets.

@fb64
Created May 18, 2017 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fb64/2697242cd5224287e52f6837001b35a5 to your computer and use it in GitHub Desktop.
Save fb64/2697242cd5224287e52f6837001b35a5 to your computer and use it in GitHub Desktop.
#!/bin/bash
#run certbot to renew certificate
certbot renew --pre-hook "service haproxy stop" --post-hook "service haproxy start"
#update certificate file for haproxy
DOMAIN='your-domain.com' sudo -E bash -c 'cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /etc/haproxy/certs/$DOMAIN.pem'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment