31 lines
953 B
Bash
31 lines
953 B
Bash
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: LE SERVICES 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 SERVICES CERT AUTO UPDATER
|
|
# Description: Restart services automatically when a new Let's Encrypt certificate is issued.
|
|
### END INIT INFO
|
|
systemctl restart postfix
|
|
systemctl restart dovecot
|
|
|
|
# pro-tftp
|
|
cat /root/.acme.sh/server.example.com/fullchain.pem > /etc/ssl/private/pure-ftpd.pem
|
|
cat /root/.acme.sh/server.example.com/server.example.com.key >> /etc/ssl/private/pure-ftpd.pem
|
|
systemctl restart pure-ftpd-mysql.service
|
|
|
|
# influxdb
|
|
FILE=/etc/influxdb/influxdb.pem
|
|
if [ -f "$FILE" ]; then
|
|
cat /root/.acme.sh/server.example.com/fullchain.pem > /etc/influxdb/influxdb.pem && systemctl restart influxd
|
|
cat /etc/letsencrypt/live/server.example.com/server.example.com.key > /etc/influxdb/influxdb.key && systemctl restart influxd
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|