2019-08-20 23:25:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-16 15:47:02 +01:00
|
|
|
# load some functions
|
2021-03-17 17:55:56 +01:00
|
|
|
. /opt/entrypoint/utils.sh
|
2020-12-16 11:43:41 +01:00
|
|
|
|
2021-06-14 13:39:27 +02:00
|
|
|
if [ "$(grep "^SWARM_MODE=yes$" /etc/nginx/global.env)" != "" ] && [ -f /usr/sbin/nginx ] ; then
|
2021-05-26 17:18:49 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(has_value AUTO_LETS_ENCRYPT yes)" = "" ] ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-12-06 22:22:58 +01:00
|
|
|
# ask new certificates if needed
|
2020-12-16 11:43:41 +01:00
|
|
|
certbot renew --deploy-hook /opt/scripts/certbot-renew-hook.sh
|
|
|
|
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
|
|
|
job_log "[CERTBOT] renew operation done"
|
|
|
|
else
|
|
|
|
job_log "[CERTBOT] renew operation failed"
|
|
|
|
fi
|