Просмотр исходного кода

#988 use of $type instead of $TYPE from record

Fixes issue when you change the type of the record is still uses the "TYPE" from config
Jaap Marcus 5 лет назад
Родитель
Сommit
8a3de9bd0b
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      bin/v-change-dns-record

+ 6 - 2
bin/v-change-dns-record

@@ -58,13 +58,17 @@ check_hestia_demo_mode
 line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
 parse_object_kv_list "$line"
 
+if [ -z $type ]; then
+    type=$TYPE
+fi
+
 # Null priority for none MX/SRV records
-if [ "$TYPE" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
+if [ "$type" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
     priority=''
 fi
 
 # Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
-if [[ $TYPE =~ NS|CNAME|MX|PTR|SRV ]]; then
+if [[ $type =~ NS|CNAME|MX|PTR|SRV ]]; then
     trailing_dot=$(echo $dvalue | grep "\.$")
     if [ -z $trailing_dot ]; then
         dvalue="$dvalue."