Updated the script to prompt for a email address to use with letsencrypt and sets --agree-tos and --no-eff-email
This commit is contained in:
+15
-3
@@ -18,6 +18,14 @@ if [[ -z "$DOMAIN" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Ask for Cloudflare API token/key
|
||||||
read -p "Enter your Cloudflare API Token/Key: " CF_API_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..."
|
echo "Setting up virtual environment..."
|
||||||
python3 -m venv /opt/certbot/
|
python3 -m venv /opt/certbot/
|
||||||
/opt/certbot/bin/pip install --upgrade pip
|
/opt/certbot/bin/pip install --upgrade pip
|
||||||
/opt/certbot/bin/pip install certbot
|
/opt/certbot/bin/pip install certbot
|
||||||
/opt/certbot/bin/pip install certbot-dns-cloudflare
|
/opt/certbot/bin/pip install certbot-dns-cloudflare
|
||||||
|
|
||||||
# Symlink certbot
|
# Symlink certbot
|
||||||
ln -sf /opt/certbot/bin/certbot /usr/bin/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 ..."
|
echo "Requesting certificate for $DOMAIN ..."
|
||||||
certbot certonly \
|
certbot certonly \
|
||||||
|
--non-interactive \
|
||||||
|
--agree-tos \
|
||||||
|
--no-eff-email \
|
||||||
|
--email "$EMAIL" \
|
||||||
--dns-cloudflare \
|
--dns-cloudflare \
|
||||||
--dns-cloudflare-credentials /root/certbot-cloudflare/cloudflare.ini \
|
--dns-cloudflare-credentials /root/certbot-cloudflare/cloudflare.ini \
|
||||||
-d "$DOMAIN"
|
-d "$DOMAIN"
|
||||||
|
|||||||
Reference in New Issue
Block a user