20 lines
538 B
Plaintext
Executable File
20 lines
538 B
Plaintext
Executable File
#!/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
|