neb/servers/skel/docker-compose.d/custom/nginx/entrypoint.sh
2023-10-20 03:38:28 +02:00

21 lines
405 B
Bash

#!/bin/sh
trap exit TERM
if [ -n "${CERTBOT_DOMAINS}" ]; then
echo "registering..."
certbot --nginx -n --keep --agree-tos \
-m "${CERTBOT_EMAIL}" \
-d "${CERTBOT_DOMAINS}"
while :; do
echo "renewing domains..."
certbot --nginx --keep -n renew
sleep 12h &
wait $!
done &
else
echo "skipping certbot due to no domains!"
fi &
exec "$@"