Ver Fonte

fix: nameserver A record validation

Ice Lake há 3 anos atrás
pai
commit
61b32cc778
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      func/domain.sh

+ 1 - 1
func/domain.sh

@@ -622,7 +622,7 @@ is_dns_nameserver_valid() {
         remote=$(echo $r |grep ".$domain.$")
         remote=$(echo $r |grep ".$domain.$")
         if [ -n "$remote" ]; then
         if [ -n "$remote" ]; then
             zone=$USER_DATA/dns/$d.conf
             zone=$USER_DATA/dns/$d.conf
-            a_record=$(echo $r |cut -f 1 -d '.')
+            a_record=${r%.$d.}
             n_record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'")
             n_record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'")
             if [ -z "$n_record" ]; then
             if [ -z "$n_record" ]; then
                 check_result "$E_NOTEXIST" "IN A $a_record.$d does not exist"
                 check_result "$E_NOTEXIST" "IN A $a_record.$d does not exist"