ansible-role-postfix/templates/postfix-letsencrypt-hook

18 lines
406 B
Bash

#!/bin/bash
LE_LOG_DIR=/var/log/acme
DATE=$( date )
[ ! -d $LE_LOG_DIR ] && mkdir $LE_LOG_DIR
echo "$DATE" >> $LE_LOG_DIR/postfix.log
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