Skip to content

Commit

Permalink
Better handling of calm-down routine while LE renewing
Browse files Browse the repository at this point in the history
Sleep is because #1193
  • Loading branch information
dpeca committed Dec 10, 2018
1 parent 58c6ca9 commit 3d8b6a8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/v-update-letsencrypt-ssl
Expand Up @@ -25,11 +25,12 @@ source $VESTA/conf/vesta.conf
# Defining user list
users=$($BIN/v-list-users | tail -n+3 | awk '{ print $1 }')

lecounter=0

# Checking users
for user in $users; do
USER_DATA=$VESTA/data/users/$user
# Checking user certificates
lecounter=0
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
# Working on Web domain check - if is suspended
webSuspended=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf |grep "SUSPENDED='yes")
Expand All @@ -46,6 +47,10 @@ for user in $users; do
expire=$((expire / 86400))
domain=$(basename $crt |sed -e "s/.crt$//")
if [[ "$expire" -lt 31 ]]; then
if [ $lecounter -gt 0 ]; then
sleep 10
fi
((lecounter++))
aliases=$(echo "$crt_data" |grep DNS:)
aliases=$(echo "$aliases" |sed -e "s/DNS://g" -e "s/,//")
aliases=$(echo "$aliases" |tr ' ' '\n' |sed "/^$/d")
Expand All @@ -62,10 +67,6 @@ for user in $users; do
echo "$domain $msg"
fi
fi
if [ $lecounter -gt 0 ]; then
sleep 10
fi
((lecounter++))
fi
done
done
Expand Down

0 comments on commit 3d8b6a8

Please sign in to comment.