Skip to content

Commit 656d34e

Browse files
committed
Fix errors when you have sub domains of the given domain
1 parent 5c98639 commit 656d34e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/v-check-letsencrypt-domain

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ is_object_unsuspended 'user' 'USER' "$user"
3636
if [ ! -e "$USER_DATA/ssl/le.conf" ]; then
3737
check_result $E_NOTEXIST "LetsEncrypt key doesn't exist"
3838
fi
39-
check_domain=$(grep -w "$domain" $USER_DATA/web.conf)
40-
if [ -z "$check_domain" ]; then
39+
rdomain=$(egrep "'$domain'|'$domain,|,$domain,|,$domain'" $USER_DATA/web.conf)
40+
if [ -z "$rdomain" ]; then
4141
check_result $E_NOTEXIST "domain $domain doesn't exist"
4242
fi
4343

@@ -48,7 +48,7 @@ fi
4848

4949
source $USER_DATA/ssl/le.conf
5050
api='https://acme-v01.api.letsencrypt.org'
51-
r_domain=$(echo "$check_domain" |cut -f 2 -d \')
51+
r_domain=$(echo "$rdomain" |cut -f 2 -d \')
5252
key="$USER_DATA/ssl/user.key"
5353
exponent="$EXPONENT"
5454
modulus="$MODULUS"

0 commit comments

Comments
 (0)