File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed
Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88### Bugfixes
99
1010- Disable /reset/ endpoint when POLICY_SYSTEM_PASSWORD_RESET = no
11+ - Prevent SOA count up after v-change-dns-records with no changes are made
1112
1213## [ 1.4.17] - Service release
1314
Original file line number Diff line number Diff line change @@ -62,11 +62,15 @@ check_hestia_demo_mode
6262# Action #
6363# ----------------------------------------------------------#
6464
65+ # Make sure the variable for the optional parameter TTL is empty before parsing
66+ # We depend on that later on
67+ unset TTL
68+
6569# Parsing domain config
6670line=$( grep " ID='$id '" $USER_DATA /dns/$domain .conf)
6771parse_object_kv_list " $line "
6872
69- if [ -z $type ]; then
73+ if [ -z " $type " ]; then
7074 type=$TYPE
7175fi
7276
8791is_dns_fqnd " $TYPE " " $dvalue "
8892is_dns_nameserver_valid " $domain " " $TYPE " " $dvalue "
8993
90- # Deleting old record
91- sed -i " /^ID='$id '/d" " $USER_DATA /dns/$domain .conf"
94+ if [[ " $RECORD " == " $record " ]] && [[ " $TYPE " == " $type " ]] && [[ " $PRIORITY " -eq " $priority " ]] \
95+ && [[ " $VALUE " == " $dvalue " ]] && [[ " $SUSPENDED " == ' no' ]] && [[ " $TTL " -eq " $ttl " ]]; then
96+ echo " No pending changes in DNS entry."
97+ exit " $E_EXSIST "
98+ fi
9299
93100# Generating timestamp
94101time_n_date=$( date +' %T %F' )
@@ -99,6 +106,9 @@ date=$(echo "$time_n_date" |cut -f 2 -d \ )
99106dns_rec=" ID='$id ' RECORD='$record ' TYPE='$type ' PRIORITY='$priority '"
100107dns_rec=" $dns_rec VALUE='$dvalue ' SUSPENDED='no' TIME='$time ' DATE='$date '"
101108[ -n " $ttl " ] && dns_rec=" $dns_rec TTL='$ttl '"
109+ # Deleting old record
110+ sed -i " /^ID='$id '/d" $USER_DATA /dns/$domain .conf
111+ # Add new entry
102112echo " $dns_rec " >> $USER_DATA /dns/$domain .conf
103113
104114# Sorting records
Original file line number Diff line number Diff line change @@ -1083,6 +1083,30 @@ function check_ip_not_banned(){
10831083 refute_output
10841084}
10851085
1086+ @test " DNS: Change DNS record" {
1087+ run v-change-dns-record $user $domain 20 test A 198.18.0.125 " " " " 1500
1088+ assert_success
1089+ refute_output
1090+ }
1091+
1092+ @test " DNS: Change DNS record (no update)" {
1093+ run v-change-dns-record $user $domain 20 test A 198.18.0.125 " " " " 1500
1094+ assert_failure $E_EXSIST
1095+ }
1096+
1097+ @test " DNS: Change DNS record id" {
1098+ run v-change-dns-record-id $user $domain 20 21
1099+ assert_success
1100+ refute_output
1101+ # Change back
1102+ run v-change-dns-record-id $user $domain 21 20
1103+ }
1104+
1105+ @test " DNS: Change DNS record id (no update)" {
1106+ run v-change-dns-record-id $user $domain 20 20
1107+ assert_failure $E_EXSIST
1108+ }
1109+
10861110@test " DNS: Delete domain record" {
10871111 run v-delete-dns-record $user $domain 20
10881112 assert_success
You can’t perform that action at this time.
0 commit comments