2023-10-20 02:09:03 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
trap exit TERM
|
|
|
|
|
|
|
|
if [ -n "${CERTBOT_DOMAINS}" ]; then
|
2023-10-20 02:43:56 +02:00
|
|
|
sleep 5
|
2023-10-20 02:09:03 +02:00
|
|
|
echo "registering domains..."
|
|
|
|
|
|
|
|
certbot --nginx -n --agree-tos \
|
|
|
|
-m "${CERTBOT_EMAIL}" \
|
|
|
|
-d "${CERTBOT_DOMAINS}"
|
|
|
|
|
|
|
|
while :; do
|
|
|
|
echo "renewing domains..."
|
|
|
|
certbot --nginx -n renew
|
|
|
|
sleep 12h & wait $!
|
|
|
|
done &
|
|
|
|
else
|
|
|
|
echo "skipping certbot due to no domains!"
|
2023-10-20 02:43:56 +02:00
|
|
|
fi &
|
2023-10-20 02:09:03 +02:00
|
|
|
|
2023-10-20 02:43:56 +02:00
|
|
|
exec "$@"
|