Browse Source

Merge pull request #812 from pcfreak30/hotfix/811

Automatically quote DNS records that have special characters
Serghey Rodin 9 years ago
parent
commit
ce1be73afa
1 changed files with 6 additions and 0 deletions
  1. 6 0
      bin/v-add-dns-record

+ 6 - 0
bin/v-add-dns-record

@@ -49,6 +49,12 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
     fi
 fi
 
+dvalue=${dvalue//\"/}
+
+if [[ "dvalue" =~ [^\;\s] ]]; then
+    dvalue='"'"$dvalue"'"'
+fi
+
 
 #----------------------------------------------------------#
 #                    Verifications                         #