#!/bin/bash LE_CERT_DIR=/etc/letsencrypt/live HAPROXY_CERT_DIR=/etc/ssl/certs/haproxy # Cat the certificate chain and the private key together for haproxy for path in $(find $LE_CERT_DIR/* -type d -exec basename {} \;); do cat $LE_CERT_DIR/$path/{fullchain.pem,privkey.pem} > $HAPROXY_CERT_DIR/${path}.pem done