docker-swag/root/etc/s6-overlay/s6-rc.d/init-renew/run

12 lines
520 B
Plaintext
Raw Normal View History

2020-08-03 15:00:14 +00:00
#!/usr/bin/with-contenv bash
2022-11-22 20:55:25 +00:00
# shellcheck shell=bash
2020-08-03 15:00:14 +00:00
# Check if the cert is expired or expires within a day, if so, renew
2022-11-22 20:55:25 +00:00
if openssl x509 -in /config/keys/letsencrypt/fullchain.pem -noout -checkend 86400 >/dev/null; then
2020-08-03 15:00:14 +00:00
echo "The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am)."
else
echo "The cert is either expired or it expires within the next day. Attempting to renew. This could take up to 10 minutes."
/app/le-renew.sh
sleep 1
2021-04-27 15:08:22 +00:00
fi