Some scripts to create and renew all your certificates, and concatenate fullchain and privkey so haproxy is able to use it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
575 B

  1. #!/bin/bash
  2. if [ $# -ne 1 ] ; then
  3. echo "$(date +%c) Please give domain name as parameter"
  4. exit 1
  5. fi
  6. echo "$(date +%c) Generate certificat for ${1}"
  7. /root/letsencrypt/certbot-auto certonly --domains $1 --renew-by-default --http-01-port 63443 --agree-tos
  8. if [ $? -eq 0 ]; then
  9. echo "$(date +%c) Success ! Now creating ${1}.pem"
  10. cat /etc/letsencrypt/live/$1/fullchain.pem /etc/letsencrypt/live/$1/privkey.pem > /etc/haproxy/cert/$1.pem
  11. service haproxy reload
  12. else
  13. echo "$(date +%c) Error creating certificate with error code $?, exit script..."
  14. fi
  15. exit 0