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

18 lines
406 B
Plaintext
Raw Normal View History

2020-06-08 16:57:40 +02:00
#!/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