Explorar o código

Merge pull request #1065 from Skamasle/patch-12

Remove trailing dot
System Void %!s(int64=9) %!d(string=hai) anos
pai
achega
b370cbf62b
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      bin/v-add-dns-record

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

@@ -109,6 +109,16 @@ if [ ! -z "$DNS_CLUSTER" ]; then
     fi
 fi
 
+# remove trailing dot at the end of NS/CNAME/MX/PTR/SRV record
+
+if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
+    trailing_dot2=$(echo $record | grep "\.$")
+    if [ ! -z $trailing_dot2 ]; then
+        record=$(echo "${record::-1}")
+    fi
+fi
+
+
 
 #----------------------------------------------------------#
 #                       Vesta                              #