From 46d755301748ad00c0fb33555d7442f10bb9b776 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 3 May 2026 12:18:35 +0100 Subject: [PATCH] Updated the script to prompt for a email address to use with letsencrypt and sets --agree-tos and --no-eff-email --- certbot-setup.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/certbot-setup.sh b/certbot-setup.sh index 4366af5..daaef9c 100755 --- a/certbot-setup.sh +++ b/certbot-setup.sh @@ -18,6 +18,14 @@ if [[ -z "$DOMAIN" ]]; then exit 1 fi +# Ask for email (NEW) +read -p "Enter email address for Let's Encrypt notifications: " EMAIL + +if [[ -z "$EMAIL" ]]; then + echo "Email cannot be empty" + exit 1 +fi + # Ask for Cloudflare API token/key read -p "Enter your Cloudflare API Token/Key: " CF_API_KEY @@ -32,9 +40,9 @@ apt install -y python3 python3-dev python3-venv libaugeas-dev gcc echo "Setting up virtual environment..." python3 -m venv /opt/certbot/ - /opt/certbot/bin/pip install --upgrade pip - /opt/certbot/bin/pip install certbot - /opt/certbot/bin/pip install certbot-dns-cloudflare +/opt/certbot/bin/pip install --upgrade pip +/opt/certbot/bin/pip install certbot +/opt/certbot/bin/pip install certbot-dns-cloudflare # Symlink certbot ln -sf /opt/certbot/bin/certbot /usr/bin/certbot @@ -51,6 +59,10 @@ chmod 600 /root/certbot-cloudflare/cloudflare.ini echo "Requesting certificate for $DOMAIN ..." certbot certonly \ + --non-interactive \ + --agree-tos \ + --no-eff-email \ + --email "$EMAIL" \ --dns-cloudflare \ --dns-cloudflare-credentials /root/certbot-cloudflare/cloudflare.ini \ -d "$DOMAIN"