Skip to content

Commit 84d1235

Browse files
committed
Do not use cli args before validation
1 parent 87e2b92 commit 84d1235

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ query_le_v2() {
5353
curl -s -i -d "$post_data" "$1" -H "$content"
5454
}
5555

56-
# Set DNS CAA record retrieval commands
57-
if [ ! -z "$DNS_SYSTEM" ]; then
58-
dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
59-
caa_record=$($BIN/v-list-dns-records $user $domain | grep -i "CAA" | cut -d' ' -f1)
60-
fi
6156

6257
#----------------------------------------------------------#
6358
# Verifications #
@@ -71,6 +66,12 @@ if [ ! -z "$mail" ]; then
7166
is_boolean_format_valid "$mail" 'mail'
7267
fi
7368

69+
# Set DNS CAA record retrieval commands
70+
if [ ! -z "$DNS_SYSTEM" ]; then
71+
dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
72+
caa_record=$($BIN/v-list-dns-records $user $domain | grep -i "CAA" | cut -d' ' -f1)
73+
fi
74+
7475
if [ -z "$mail" ] || [ "$mail" = 'no' ]; then
7576
mail=''
7677
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'

0 commit comments

Comments
 (0)