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;