From 3611b888e572257eb0b6a18b4627452452686c20 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Tue, 13 Apr 2021 18:55:22 +0200 Subject: [PATCH] Update v-update-letsencrypt-ssl --- bin/v-update-letsencrypt-ssl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/v-update-letsencrypt-ssl b/bin/v-update-letsencrypt-ssl index 80b07159..ac3e2eda 100755 --- a/bin/v-update-letsencrypt-ssl +++ b/bin/v-update-letsencrypt-ssl @@ -33,16 +33,20 @@ for user in $($BIN/v-list-users plain |cut -f 1); do for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do + limit_check=1 fail_counter=$(get_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT') - if [[ "$fail_counter" -eq 7 ]]; then - if [ "$hostname" = "$domain" ]; then + if [[ "$hostname" = "$domain" ]]; then + if [[ "$fail_counter" -eq 7 ]]; then + limit_check=0 + fi + if [[ "$fail_counter" -eq 8 ]]; then fail_counter=$(alter_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT') send_email_to_admin "LetsEncrypt renewing hostname $hostname" "Warning: hostname $domain failed for LetsEncrypt renewing" fi fi - if [[ "$fail_counter" -ge 7 ]]; then + if [[ "$fail_counter" -ge 7 ]] && [[ "$limit_check" -eq 1 ]]; then # echo "$domain failed $fail_counter times for LetsEncrypt renewing, skipping" echo "[$(date)] : $domain failed $fail_counter times for LetsEncrypt renewing, skipping" >> /usr/local/vesta/log/letsencrypt_cron.log continue;