diff --git a/servers/skel/docker-compose.d/custom/nginx/entrypoint.sh b/servers/skel/docker-compose.d/custom/nginx/entrypoint.sh index fa1fe3e..df5fa5c 100644 --- a/servers/skel/docker-compose.d/custom/nginx/entrypoint.sh +++ b/servers/skel/docker-compose.d/custom/nginx/entrypoint.sh @@ -4,9 +4,16 @@ trap exit TERM if [ -n "${CERTBOT_DOMAINS}" ]; then echo "registering..." - certbot --nginx -n --keep --agree-tos \ - -m "${CERTBOT_EMAIL}" \ - -d "${CERTBOT_DOMAINS}" + 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 while :; do echo "renewing domains..." @@ -18,4 +25,4 @@ else echo "skipping certbot due to no domains!" fi & -exec "$@" +exec "$@" \ No newline at end of file