Skip to content

Commit 6d3c99e

Browse files
committed
DNS Records: Use internal method of un/suspending objects
Fix: Dns records TTL value was lost when un/suspending
1 parent f91be28 commit 6d3c99e

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

bin/v-suspend-dns-record

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,7 @@ check_hestia_demo_mode
4848
# Action #
4949
#----------------------------------------------------------#
5050

51-
line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
52-
parse_object_kv_list "$line"
53-
sed -i "/^ID='$id'/d" $USER_DATA/dns/$domain.conf
54-
55-
# Adding record
56-
dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$PRIORITY'"
57-
dns_rec="$dns_rec VALUE='$VALUE' SUSPENDED='yes' TIME='$TIME' DATE='$DATE'"
58-
echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
59-
60-
# Sorting records
61-
sort_dns_records
51+
update_object_value "dns/$domain" 'ID' "$id" '$SUSPENDED' "yes"
6252

6353
# Updating zone
6454
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then

bin/v-unsuspend-dns-record

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,7 @@ is_object_valid "dns/$domain" 'ID' "$id"
4444
# Action #
4545
#----------------------------------------------------------#
4646

47-
line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
48-
parse_object_kv_list "$line"
49-
sed -i "/^ID='$id'/d" $USER_DATA/dns/$domain.conf
50-
51-
# Adding record
52-
dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$PRIORITY'"
53-
dns_rec="$dns_rec VALUE='$VALUE' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
54-
echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
55-
56-
# Sorting records
57-
sort_dns_records
47+
update_object_value "dns/$domain" 'ID' "$id" '$SUSPENDED' "no"
5848

5949
# Updating zone
6050
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then

0 commit comments

Comments
 (0)