Do not restart when the certificate did not change.
This commit is contained in:
parent
1fa3343662
commit
84b92decb4
|
@ -12,13 +12,21 @@ echo "$DATE" > $LE_LOG_DIR/mongodb.log
|
|||
|
||||
[ ! -d $MONGODB_CERTDIR ] && mkdir $MONGODB_CERTDIR
|
||||
|
||||
cat ${LE_CERTS_DIR}/{cert,privkey} > ${MONGODB_CERTFILE}.new
|
||||
cmp ${MONGODB_CERTFILE}.new ${MONGODB_CERTFILE} 2>/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
echo "The certificate is up to date" >> $LE_LOG_DIR/mongodb.log
|
||||
rm -f ${MONGODB_CERTFILE}.new
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Building the new certificate file" >> $LE_LOG_DIR/mongodb.log
|
||||
cat ${LE_CERTS_DIR}/{cert,privkey} > ${MONGODB_CERTFILE}
|
||||
/bin/mv -f ${MONGODB_CERTFILE}.new ${MONGODB_CERTFILE}
|
||||
chmod 440 ${MONGODB_CERTFILE}
|
||||
chgrp mongodb ${MONGODB_CERTFILE}
|
||||
|
||||
{% if mongodb_ssl_enabled %}
|
||||
echo "Reload the mongod service" >> "$LE_LOG_DIR/mongodb.log"
|
||||
echo "Restart the mongod service, reload is not supported" >> "$LE_LOG_DIR/mongodb.log"
|
||||
{% if mongodb_install_from_external_repo %}
|
||||
service mongod stop >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
||||
sleep 10
|
||||
|
|
Loading…
Reference in New Issue