Pure-FTPd + Let’s Encrypt

The script presented below allows the Pure-FTPd server to work with certificates signed with Let’s Encrypt. The script compares the currently used Let’s Encrypt certificate with the one used by the FTP server. If it detects changes, the script creates a new file compatible with Pure-FTPd. Thanks to this, the script can operate in the cron level and check certificates periodically.

Download & start (must be logged in as root):
# cd /opt
# wget http://www.marcinwilk.eu/crtchk.sh
# chmod +x crtchk.sh

You must edit this script and set paths according to Your files position.

# vim crtchk.sh

./crtchk.sh

To make your work easier, you can add this script to the cron so you don’t have to watch and run it yourself every time your certificate is renewed by Let’s Encrypt.

Adding cyclic script launch every 10 minutes:
# crontab -e

Add line:
*/10 * * * * /opt/crtchk.sh >> /dev/null

And save changes.

If certificate will be updated, then there will be output log in /var/log/pure-ftpd-crt.log file.