[mod] added PRODUCTION check for certbot

This commit is contained in:
2020-04-05 20:36:15 -04:00
parent b14fc1f0c1
commit 0e537ee1cd
3 changed files with 19 additions and 11 deletions

View File

@@ -138,17 +138,23 @@ function get_cert()
if [ $webserver_exists -eq 1 ] ; then
log get_cert "Getting cert for [$root_domain] with [$domains]"
# certbotx certonly \
# --config-dir "$cert_bot_path" \
# --agree-tos \
# --domains "$domains" \
# --email "contact@${root_domain}" \
# --no-eff-email \
# --expand \
# --noninteractive \
# --webroot \
# --webroot-path "$web_root_path" \
# $OPTIONS || true
# PRODUCTION needs to be set in env
if [ -z ${PRODUCTION+x} ]; then
log WARNING get_cert "PRODUCTION not set, exiting"
return 0
fi
log get_cert "Running certbot"
certbot certonly \
--config-dir "$cert_bot_path" \
--agree-tos \
--domains "$domains" \
--email "contact@${root_domain}" \
--no-eff-email \
--expand \
--noninteractive \
--webroot \
--webroot-path "$web_root_path"
# $OPTIONS || true
else
log get_cert ERROR "Webserver for [$root_domain] not reachable after $server_retries retries"
return 1