#!/usr/bin/env bash # # Copy dehydrated generated certs into /var/local/certificates and # set required ownership. Also restart local services as appropriate. action=$1 shift deploy_cert() { cp -R /var/lib/dehydrated/certs/* /var/local/certificates/ chown -R root:ssl-cert /var/local/certificates/ DOMAIN="$1" case $DOMAIN in "mail.lunch.org.uk") systemctl restart exim4 ;; esac } case $action in deploy_cert) deploy_cert "$@" ;; esac