Browse Source

Do not use cli args before validation

Robert Zollner 6 years ago
parent
commit
84d123590f
1 changed files with 6 additions and 5 deletions
  1. 6 5
      bin/v-add-letsencrypt-domain

+ 6 - 5
bin/v-add-letsencrypt-domain

@@ -53,11 +53,6 @@ query_le_v2() {
     curl -s -i -d "$post_data" "$1" -H "$content"
 }
 
-# Set DNS CAA record retrieval commands
-if [ ! -z "$DNS_SYSTEM" ]; then
-    dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
-    caa_record=$($BIN/v-list-dns-records $user $domain | grep -i "CAA" | cut -d' ' -f1)
-fi
 
 #----------------------------------------------------------#
 #                    Verifications                         #
@@ -71,6 +66,12 @@ if [ ! -z "$mail" ]; then
     is_boolean_format_valid "$mail" 'mail'
 fi
 
+# Set DNS CAA record retrieval commands
+if [ ! -z "$DNS_SYSTEM" ]; then
+    dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
+    caa_record=$($BIN/v-list-dns-records $user $domain | grep -i "CAA" | cut -d' ' -f1)
+fi
+
 if [ -z "$mail" ] || [ "$mail" = 'no' ]; then
     mail=''
     is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'