2023-07-10 17:54:59 +01:00
|
|
|
#!/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() {
|
2023-08-06 11:07:16 +01:00
|
|
|
cp -a /var/lib/dehydrated/certs/* /var/local/certificates/
|
2023-07-10 17:54:59 +01:00
|
|
|
chown -R root:ssl-cert /var/local/certificates/
|
|
|
|
|
|
|
|
DOMAIN="$1"
|
|
|
|
case $DOMAIN in
|
|
|
|
"mail.lunch.org.uk")
|
|
|
|
systemctl restart exim4
|
2023-08-06 11:07:16 +01:00
|
|
|
systemctl reload dovecot
|
2023-07-10 17:54:59 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
case $action in
|
|
|
|
deploy_cert)
|
|
|
|
deploy_cert "$@"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|