From b85e943fd1e2113ae875ce3b25b559b285510a1a Mon Sep 17 00:00:00 2001 From: Raine Date: Fri, 20 Oct 2023 04:37:44 +0200 Subject: [PATCH] refactor: certbot stuff it's weird --- .../docker-compose.d/custom/nginx/entrypoint.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/servers/link/docker-compose.d/custom/nginx/entrypoint.sh b/servers/link/docker-compose.d/custom/nginx/entrypoint.sh index fa1fe3e..2599e15 100644 --- a/servers/link/docker-compose.d/custom/nginx/entrypoint.sh +++ b/servers/link/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..."