22 lines
431 B
Bash
22 lines
431 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
trap exit TERM
|
||
|
|
||
|
if [ -n "${CERTBOT_DOMAINS}" ]; then
|
||
|
echo "registering domains..."
|
||
|
|
||
|
certbot --nginx -n --agree-tos \
|
||
|
-m "${CERTBOT_EMAIL}" \
|
||
|
-d "${CERTBOT_DOMAINS}"
|
||
|
|
||
|
while :; do
|
||
|
echo "renewing domains..."
|
||
|
certbot --nginx -n renew
|
||
|
nginx -s reload
|
||
|
sleep 12h & wait $!
|
||
|
done &
|
||
|
else
|
||
|
echo "skipping certbot due to no domains!"
|
||
|
fi
|
||
|
|
||
|
exec nginx -g "daemon off;"
|