#!/bin/bash -e cd /etc/ [ -d letsencrypt~ ] \ && diff -rq letsencrypt/ letsencrypt~/ \ && exit 0 ( echo "Subject: New /etc/letsencrypt/ on Droplet." echo "" tar czf - letsencrypt/ \ | gpg --encrypt --armor \ --trust-model always --recipient root@core ) \ | sendmail root \ || exit $? rm -rf letsencrypt~ cp -a letsencrypt letsencrypt~