mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-08 08:40:13 +08:00
Fix multiple domains in renewal.
This commit is contained in:
parent
0fb4e2bf6a
commit
48f276f88d
@ -17,17 +17,19 @@ MY_DOMAIN=example.com
|
|||||||
# Set the directory that the certificates will be copied to.
|
# Set the directory that the certificates will be copied to.
|
||||||
CERTIFICATE_DIR=/etc/mosquitto/certs
|
CERTIFICATE_DIR=/etc/mosquitto/certs
|
||||||
|
|
||||||
if [ "${RENEWED_DOMAINS}" = "${MY_DOMAIN}" ]; then
|
for D in ${RENEWED_DOMAINS}; do
|
||||||
# Copy new certificate to Mosquitto directory
|
if [ "${D}" = "${MY_DOMAIN}" ]; then
|
||||||
cp ${RENEWED_LINEAGE}/fullchain.pem ${CERTIFICATE_DIR}/server.pem
|
# Copy new certificate to Mosquitto directory
|
||||||
cp ${RENEWED_LINEAGE}/privkey.pem ${CERTIFICATE_DIR}/server.key
|
cp ${RENEWED_LINEAGE}/fullchain.pem ${CERTIFICATE_DIR}/server.pem
|
||||||
|
cp ${RENEWED_LINEAGE}/privkey.pem ${CERTIFICATE_DIR}/server.key
|
||||||
|
|
||||||
# Set ownership to Mosquitto
|
# Set ownership to Mosquitto
|
||||||
chown mosquitto: ${CERTIFICATE_DIR}/server.pem ${CERTIFICATE_DIR}/server.key
|
chown mosquitto: ${CERTIFICATE_DIR}/server.pem ${CERTIFICATE_DIR}/server.key
|
||||||
|
|
||||||
# Ensure permissions are restrictive
|
# Ensure permissions are restrictive
|
||||||
chmod 0600 ${CERTIFICATE_DIR}/server.pem ${CERTIFICATE_DIR}/server.key
|
chmod 0600 ${CERTIFICATE_DIR}/server.pem ${CERTIFICATE_DIR}/server.key
|
||||||
|
|
||||||
# Tell Mosquitto to reload certificates and configuration
|
# Tell Mosquitto to reload certificates and configuration
|
||||||
pkill -HUP -x mosquitto
|
pkill -HUP -x mosquitto
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user