better error check

This commit is contained in:
rootzoll 2021-09-22 22:21:57 +02:00
parent 383fa34cd4
commit 4e91c43aea

View file

@ -148,7 +148,7 @@ function refresh_certs_with_nginx() {
echo "# FQDN(${FQDN})"
# check if there is a LetsEncrypt Subscription for this domain
details=$(/home/admin/config.scripts/blitz.subscriptions.letsencrypt.py subscription-detail $FQDN)
if [ ${#details} -gt 10 ]; then
if [ $(echo "${details}" | grep -c "error=") -eq 0 ] && [ ${#details} -gt 10 ]; then
echo "# details(${details})"
@ -344,6 +344,8 @@ elif [ "$1" = "remove-cert" ]; then
options="ip&tor"
fi
echo "# bonus.letsencrypt.sh remove-cert ${FQDN} ${options}"
# remove cert from renewal
$ACME_INSTALL_HOME/acme.sh --remove -d "${FQDN}" --ecc --home "${ACME_INSTALL_HOME}" --config-home "${ACME_CONFIG_HOME}" --cert-home "${ACME_CERT_HOME}" 2>&1