neb/images/nginx/entrypoint.sh
Raine 83a548ca8f feat: nebulosus tmp solution
Signed-off-by: Raine <raine@ixvd.net>
2024-03-29 17:04:43 +01:00

28 lines
No EOL
580 B
Bash
Executable file

#!/bin/sh
trap exit TERM
if [ -n "${CERTBOT_DOMAINS}" ]; then
echo "registering..."
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..."
certbot --nginx --keep -n renew
sleep 12h &
wait $!
done &
else
echo "skipping certbot due to no domains!"
fi &
exec "$@"