Skip to content

Commit d195d10

Browse files
committed
Bringing back Better handling of calm-down routine while LE renewing
1 parent 5db91f9 commit d195d10

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bin/v-update-letsencrypt-ssl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ source $HESTIA/conf/hestia.conf
2222
# Action #
2323
#----------------------------------------------------------#
2424

25+
# Set LE counter
26+
lecounter=0
27+
2528
# Checking user certificates
2629
for user in $($BIN/v-list-users plain |cut -f 1); do
2730
USER_DATA=$HESTIA/data/users/$user
28-
lecounter=0
2931

3032
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
3133
crt_data=$(openssl x509 -text -in $USER_DATA/ssl/$domain.crt)
@@ -35,6 +37,10 @@ for user in $($BIN/v-list-users plain |cut -f 1); do
3537
seconds_valid=$((expiration - now))
3638
days_valid=$((seconds_valid / 86400))
3739
if [[ "$days_valid" -lt 31 ]]; then
40+
if [ $lecounter -gt 0 ]; then
41+
sleep 10
42+
fi
43+
((lecounter++))
3844
aliases=$(echo "$crt_data" |grep DNS:)
3945
aliases=$(echo "$aliases" |sed -e "s/DNS://g" -e "s/,//")
4046
aliases=$(echo "$aliases" |tr ' ' '\n' |sed "/^$/d")
@@ -44,10 +50,6 @@ for user in $($BIN/v-list-users plain |cut -f 1); do
4450
if [ $? -ne 0 ]; then
4551
echo "$domain $msg"
4652
fi
47-
if [ $lecounter -gt 0 ]; then
48-
sleep 10
49-
fi
50-
((lecounter++))
5153
fi
5254
done
5355
done

0 commit comments

Comments
 (0)