initial commit
This commit is contained in:
commit
f6b4c20e4a
14 changed files with 160 additions and 0 deletions
19
rootfs/bin/renew-certificates
Executable file
19
rootfs/bin/renew-certificates
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue