File tree Expand file tree Collapse file tree 6 files changed +25
-13
lines changed
Expand file tree Collapse file tree 6 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,11 @@ cat $V_DNSTPL/$template.tpl |\
100100 -e " s/%ns8%/$ns8 /g" \
101101 -e " s/%date%/$V_DATE /g" > $V_USERS /$user /dns/$domain
102102
103+ records=" $( wc -l $V_USERS /$user /dns/$domain ) "
104+
103105# Adding dns.conf record
104106dns_rec=" DOMAIN='$domain ' IP='$ip ' TPL='$template ' TTL='$ttl ' EXP='$exp '"
105- dns_rec=" $dns_rec SOA='$soa ' SUSPENDED='no' DATE='$V_DATE '"
107+ dns_rec=" $dns_rec SOA='$soa ' RECORDS=' $records ' SUSPENDED='no' DATE='$V_DATE '"
106108echo " $dns_rec " >> $V_USERS /$user /dns.conf
107109chmod 660 $V_USERS /$user /dns.conf
108110
@@ -125,6 +127,7 @@ chown root:named $conf
125127
126128# Increasing domain value
127129increase_user_value " $user " ' $U_DNS_DOMAINS'
130+ increase_user_value " $user " ' $U_DNS_RECORDS' " $records "
128131
129132# Adding task to the vesta pipe
130133restart_schedule ' dns'
Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ update_domain_zone
9191# Vesta #
9292# ----------------------------------------------------------#
9393
94+ # Updating dns domain values
95+ records=" $( wc -l $V_USERS /$user /dns/$domain ) "
96+ update_dns_domain_value ' $RECORDS' " $records "
97+
98+ # Updating user counters
99+ increase_user_value " $user " ' $U_DNS_RECORDS'
100+
94101# Adding task to the vesta pipe
95102restart_schedule ' dns'
96103
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ is_user_suspended
4444# Action #
4545# ----------------------------------------------------------#
4646
47+ user_records=0
48+ suspended_dns=0
49+
4750# Checking dns folder
4851if [ ! -d " $V_USERS /$user /dns" ]; then
4952 rm -f $V_USERS /$user /dns
@@ -117,20 +120,28 @@ for domain in $domains; do
117120 if [ ! -z " $rm_string " ]; then
118121 sed -i " $rm_string d" $nconf
119122 fi
123+ suspended_dns=$(( suspended_dns + 1 ))
120124 else
121125 if [ -z " $( grep /$domain .db $nconf ) " ]; then
122126 named=" zone \" $domain_idn \" {type master; file"
123127 named=" $named \" $V_HOME /$user /conf/dns/$domain .db\" ;};"
124128 echo " $named " >> /etc/named.conf
125129 fi
126130 fi
131+ records=$( wc -l $V_USERS /$user /dns/$domain | cut -f 1 -d ' ' )
132+ user_records=$(( user_records + records))
133+ update_dns_domain_value ' $RECORDS' " $records "
127134done
128135
129136
130137# ----------------------------------------------------------#
131138# Vesta #
132139# ----------------------------------------------------------#
133140
141+ # Updating counters
142+ update_user_value " $user " ' $U_DNS_RECORDS' " $user_records "
143+ update_user_value " $user " ' $SUSPENDED_DNS' " $suspended_dns "
144+
134145# Adding task to the vesta pipe
135146restart_schedule ' dns'
136147
Original file line number Diff line number Diff line change 6363
6464# Adding suspend in config
6565update_dns_domain_value ' $SUSPENDED' ' yes'
66+ increase_user_value " $user " ' $SUSPENDED_DNS'
6667
6768# Adding task to the vesta pipe
6869restart_schedule ' dns'
Original file line number Diff line number Diff line change @@ -45,23 +45,12 @@ conf="$V_USERS/$user/dns.conf"
4545
4646# Defining fileds to select
4747field=' $DOMAIN'
48-
49- # Defining search string
5048search_string=" SUSPENDED='no'"
51-
52- # Parsing unsuspeneded domains
5349domains=$( dom_clear_search)
5450
5551# Starting suspend loop
5652for domain in $domains ; do
57- # Defining named config
58- conf=" /etc/named.conf"
59- rm_string=$( grep -n /etc/namedb/$domain .db $conf | cut -d : -f 1)
60- if [ ! -z " $rm_string " ]; then
61- sed -i " $rm_string d" $conf
62- fi
63- # Adding suspend in config
64- update_dns_domain_value ' $SUSPENDED' ' yes'
53+ $V_BIN /v_suspend_web_domain " $user " " $domain " " $url "
6554done
6655
6756
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ echo "$nmd_rec" >> $conf
6161
6262# Unsuspending domain in config
6363update_dns_domain_value ' $SUSPENDED' ' no'
64+ decrease_user_value " $user " ' $SUSPENDED_DNS'
6465
6566# Adding task to the vesta pipe
6667restart_schedule ' dns'
You can’t perform that action at this time.
0 commit comments