initial commit

This commit is contained in:
Sebastian Hugentobler 2017-09-04 16:00:44 +02:00
commit f6b4c20e4a
14 changed files with 160 additions and 0 deletions

19
rootfs/bin/renew-certificates Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/with-contenv sh
cd /var/lib/postgresql
OLD_MOD=$(stat -c %y /var/lib/postgresql/.lego/certificates/${POSTGRES_DOMAIN}.crt)
lego \
--accept-tos \
--server="${POSTGRES_CA}" \
--email="${POSTGRES_ACME_EMAIL}" \
--domains="${POSTGRES_DOMAIN}" \
--dns="${POSTGRES_DNS_PROVIDER}" \
renew --days 30
NEW_MOD=$(stat -c %y /var/lib/postgresql/.lego/certificates/${POSTGRES_DOMAIN}.crt)
if [ "${OLD_MOD}" != "${NEW_MOD}" ]; then
kill -s TERM $(head -1 ${PGDATA}/postmaster.pid)
fi