run_certbot.sh does nothing if DOMAIN not set

This commit is contained in:
Ivan Folgueira Bande 2026-01-11 22:28:10 +01:00
parent d26ba09d04
commit 9739695db9
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7

View File

@ -1,10 +1,14 @@
#!/bin/sh
set -e
if [ -z "$DOMAIN" ]; then
echo "DOMAIN not set, skipping certbot"
exit 0
fi
# -------------------------------
# Configuration
# -------------------------------
DOMAIN="${DOMAIN:-changeme.xyz}" # Replace or set via env
EMAIL="${EMAIL:-admin@${DOMAIN}}" # Certbot email
WEBROOT="${WEBROOT:-/var/www/certbot}" # Path served by HTTP for ACME
SLEEP_INTERVAL="${SLEEP_INTERVAL:-12h}" # Renewal check interval