ansible-roles/postfix-relay/templates/postfix-letsencrypt-hook

25 lines
604 B
Plaintext
Raw Normal View History

#!/bin/bash
LE_SERVICES_SCRIPT_DIR=/usr/lib/acme/hooks
LE_LOG_DIR=/var/log/letsencrypt
DATE=$( date )
[ ! -d $LE_LOG_DIR ] && mkdir $LE_LOG_DIR
echo "$DATE" >> $LE_LOG_DIR/postfix.log
if [ -f /etc/default/letsencrypt ] ; then
. /etc/default/letsencrypt
else
echo "No letsencrypt default file" >> $LE_LOG_DIR/postfix.log
fi
echo "Reload the postfix service" >> $LE_LOG_DIR/postfix.log
if [ -x /bin/systemctl ] ; then
systemctl reload postfix >> $LE_LOG_DIR/postfix.log 2>&1
else
service postfix reload >> $LE_LOG_DIR/postfix.log 2>&1
fi
echo "Done." >> $LE_LOG_DIR/postfix.log
exit 0