Skip to content

Commit 8a3de9b

Browse files
committed
hestiacp#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
1 parent 97e68fc commit 8a3de9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/v-change-dns-record

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ check_hestia_demo_mode
5858
line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
5959
parse_object_kv_list "$line"
6060

61+
if [ -z $type ]; then
62+
type=$TYPE
63+
fi
64+
6165
# Null priority for none MX/SRV records
62-
if [ "$TYPE" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
66+
if [ "$type" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
6367
priority=''
6468
fi
6569

6670
# Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
67-
if [[ $TYPE =~ NS|CNAME|MX|PTR|SRV ]]; then
71+
if [[ $type =~ NS|CNAME|MX|PTR|SRV ]]; then
6872
trailing_dot=$(echo $dvalue | grep "\.$")
6973
if [ -z $trailing_dot ]; then
7074
dvalue="$dvalue."

0 commit comments

Comments
 (0)