ISPConfig-Stuff/le_mailserver_restart.sh

16 lines
621 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: LE MAILSERVER CERT AUTO UPDATER
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LE MAILSERVER CERT AUTO UPDATER
# Description: Restart mail server automatically when a new Let's Encrypt certificate is issued.
### END INIT INFO
systemctl restart postfix
systemctl restart dovecot
cat /root/.acme.sh/mail.example.com/fullchain.pem > /etc/ssl/private/pure-ftpd.pem
cat /root/.acme.sh/mail.example.com/mail.example.com.key >> /etc/ssl/private/pure-ftpd.pem
systemctl restart pure-ftpd-mysql.service