mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
21 lines
454 B
Bash
21 lines
454 B
Bash
#!/bin/sh
|
|
|
|
# load some functions
|
|
. /opt/entrypoint/utils.sh
|
|
|
|
if [ "$(grep "^SWARM_MODE=yes$" /etc/nginx/global.env)" != "" ] && [ -f /usr/sbin/nginx ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$(has_value AUTO_LETS_ENCRYPT yes)" = "" ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
# ask new certificates if needed
|
|
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
|