mosquitto-with-auth/cert-deploy.sh
Wolfgang Hottgenroth 3bf3b037f2 letsencrypt volume
2022-09-14 13:25:11 +02:00

13 lines
442 B
Bash
Executable File

#!/bin/sh
MY_DOMAIN=example.com
CERTIFICATE_DIR=/opt/etc/mosquitto/
if [ "${RENEWED_DOMAINS}" = "${MY_DOMAIN}" ]; then
cp ${RENEWED_LINEAGE}/fullchain.pem ${CERTIFICATE_DIR}/server.crt
cp ${RENEWED_LINEAGE}/privkey.pem ${CERTIFICATE_DIR}/server.key
chown mosquitto: ${CERTIFICATE_DIR}/server.crt ${CERTIFICATE_DIR}/server.key
chmod 0600 ${CERTIFICATE_DIR}/server.crt ${CERTIFICATE_DIR}/server.key
supervisorctl restart mosquitto
fi