neb/servers/link/docker-compose.d/custom/nginx/entrypoint.sh

29 lines
580 B
Bash
Raw Permalink Normal View History

2023-10-20 04:24:09 +02:00
#!/bin/sh
trap exit TERM
if [ -n "${CERTBOT_DOMAINS}" ]; then
echo "registering..."
2023-10-20 04:37:44 +02:00
if ! certbot show_account; then
certbot register -n \
--agree-tos \
-m "${CERTBOT_EMAIL}"
fi
for d in $(echo "${CERTBOT_DOMAINS}" | sed 's/,/ /g'); do
echo "requesting for $d..."
certbot --nginx -n --keep -d "$d"
done
2023-10-20 04:24:09 +02:00
while :; do
echo "renewing domains..."
certbot --nginx --keep -n renew
sleep 12h &
wait $!
done &
else
echo "skipping certbot due to no domains!"
fi &
exec "$@"