diff --git a/core_files/scripts/letsencrypt/createLetsEncryptCert.sh b/core_files/scripts/letsencrypt/createLetsEncryptCert.sh index 2ee889f..e8190fe 100644 --- a/core_files/scripts/letsencrypt/createLetsEncryptCert.sh +++ b/core_files/scripts/letsencrypt/createLetsEncryptCert.sh @@ -16,13 +16,14 @@ if ! checkDir $sslDirPath; then mkdir -p $sslDirPath fi -CLOUDFLARE_OPTS="" +WEBROOT_OPTS="--webroot --webroot-path $certStuffRoot" if [ -d "/cloudflare-account.ini" ]; then - CLOUDFLARE_OPTS+="--dns-cloudflare --dns-cloudflare-credentials /cloudflare-account.ini" + echo "Using CloudFlare API for DNS" + WEBROOT_OPTS="--dns-cloudflare --dns-cloudflare-credentials /cloudflare-account.ini" fi echo "Creating a cert for ${1}" -certbot certonly --config-dir $sslDirPath --webroot --webroot-path $certStuffRoot $CLOUDFLARE_OPTS -n --agree-tos --register-unsafely-without-email -d ${1} +certbot certonly --config-dir $sslDirPath $WEBROOT_OPTS -n --agree-tos --register-unsafely-without-email -d ${1} if [ $? -ne 0 ]; then echo "[Failure] Unable to create certificate '${1}' due to an error" exit 1 diff --git a/core_files/scripts/letsencrypt/renewAllCert.sh b/core_files/scripts/letsencrypt/renewAllCert.sh index 2c021a7..73f932f 100644 --- a/core_files/scripts/letsencrypt/renewAllCert.sh +++ b/core_files/scripts/letsencrypt/renewAllCert.sh @@ -17,7 +17,7 @@ if ! checkDir $certStuffRoot; then fi if ! checkDir $sslDirPath; then - echo "Creating ssl folder" + echo "Creating SSL folder" mkdir -p $sslDirPath fi @@ -26,9 +26,10 @@ if ! checkFile $logFile; then touch $logFile fi -CLOUDFLARE_OPTS="" +WEBROOT_OPTS="--webroot --webroot-path $certStuffRoot" if [ -d "/cloudflare-account.ini" ]; then - CLOUDFLARE_OPTS+="--dns-cloudflare --dns-cloudflare-credentials /cloudflare-account.ini" + echo "Using CloudFlare API for DNS" + WEBROOT_OPTS="--dns-cloudflare --dns-cloudflare-credentials /cloudflare-account.ini" fi -certbot renew $CLOUDFLARE_OPTS --config-dir $sslDirPath --webroot --webroot-path $certStuffRoot >> /scripts/letsencrypt/letsencrypt-renew.log \ No newline at end of file +certbot renew --config-dir $sslDirPath $WEBROOT_OPTS >> /scripts/letsencrypt/letsencrypt-renew.log \ No newline at end of file