Skip to content

Commit bb0f1d8

Browse files
committed
Correcting wildcard, thanks to @skullwritter
1 parent 426281e commit bb0f1d8

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
@@ -68,12 +68,15 @@ if [ -z "$mail" ]; then
6868
is_object_valid 'web' 'DOMAIN' "$domain"
6969
is_object_unsuspended 'web' 'DOMAIN' "$domain"
7070
get_domain_values 'web'
71-
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
72-
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
73-
if [ -z "$check_alias" ]; then
74-
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
75-
fi
76-
done
71+
# check if alias is the letsencrypt wildcard domain, if not, make the normal checks
72+
if [[ "$aliases" != "*.$domain" ]]; then
73+
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
74+
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
75+
if [ -z "$check_alias" ]; then
76+
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
77+
fi
78+
done
79+
fi;
7780
else
7881
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
7982
is_object_valid 'mail' 'DOMAIN' "$domain"

0 commit comments

Comments
 (0)