0

Letsencrypt – simple renew in bash

Simple renew routine in bash to renew certificates with let’s encrypt.

#!/bin/sh
for domain in $RENEWED_DOMAINS; do
        cat "$RENEWED_LINEAGE/privkey.pem" "$RENEWED_LINEAGE/fullchain.pem" > "/etc/ssl/certs/haproxy/${domain}.pem"
done

And then just call renew using certbot and specify script as parameter for renew

certbot renew --quiet --renew-hook /scripts/renew-hook-pem.sh >/dev/null 2>&1

 

Add this to your crontab and ur done! Doing it differently ? Share in comments!

 

rafpe

Leave a Reply

Your email address will not be published. Required fields are marked *