Skip to content

Commit 02fe912

Browse files
committed
Check if alias is the le widcard, thanks to @skullwritter!
1 parent 0657647 commit 02fe912

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ is_object_unsuspended 'user' 'USER' "$user"
6262
is_object_valid 'web' 'DOMAIN' "$domain"
6363
is_object_unsuspended 'web' 'DOMAIN' "$domain"
6464
get_domain_values 'web'
65-
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
66-
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
67-
if [ -z "$check_alias" ]; then
68-
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
69-
fi
70-
done
65+
# check if alias is the letsencrypt wildcard domain, if not, make the normal checks
66+
if [[ "$aliases" != "*.$domain" ]]; then
67+
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
68+
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
69+
if [ -z "$check_alias" ]; then
70+
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
71+
fi
72+
done
73+
fi;
7174

7275

7376
#----------------------------------------------------------#

0 commit comments

Comments
 (0)