renamed zones folder to dns

This commit is contained in:
Serghey Rodin 2011-11-22 14:02:00 +02:00
commit add6ebe952
10 changed files with 21 additions and 21 deletions

View file

@ -76,7 +76,7 @@ if [ -z "$soa" ]; then
soa="$ns1"
fi
# Adding zone to zones dir
# Adding zone to dns dir
cat $V_DNSTPL/$template.tpl |\
sed -e "s/%ip%/$ip/g" \
-e "s/%domain_idn%/$domain_idn/g" \
@ -89,7 +89,7 @@ cat $V_DNSTPL/$template.tpl |\
-e "s/%ns6%/$ns6/g" \
-e "s/%ns7%/$ns7/g" \
-e "s/%ns8%/$ns8/g" \
-e "s/%date%/$V_DATE/g" > $V_USERS/$user/zones/$domain
-e "s/%date%/$V_DATE/g" > $V_USERS/$user/dns/$domain
# Adding dns.conf record
dns_rec="DOMAIN='$domain' IP='$ip' TPL='$template' TTL='$ttl' EXP='$exp'"

View file

@ -63,7 +63,7 @@ is_dns_record_free
#----------------------------------------------------------#
# Defining zone path
zone="$V_USERS/$user/zones/$domain"
zone="$V_USERS/$user/dns/$domain"
# Adding record
dns_rec="ID='$id' RECORD='$record' TYPE='$rtype' VALUE='$dvalue'"

View file

@ -111,7 +111,7 @@ fi
if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then
touch $V_USERS/$user/dns.conf
mkdir $V_USERS/$user/zones
mkdir $V_USERS/$user/dns
fi
if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then

View file

@ -54,7 +54,7 @@ old_ip=$(get_dns_domain_value '$IP')
update_dns_domain_value '$IP' "$ip"
# Changing records
sed -i "s/$old_ip/$ip/g" $V_USERS/$user/zones/$domain
sed -i "s/$old_ip/$ip/g" $V_USERS/$user/dns/$domain
# Updating zone
update_domain_zone

View file

@ -54,7 +54,7 @@ is_dns_record_valid
#----------------------------------------------------------#
# Defining zone path
zone="$V_USERS/$user/zones/$domain"
zone="$V_USERS/$user/dns/$domain"
# Deleting old record
rm_string=$(grep -n "^ID='$id'" $zone|cut -d : -f 1)

View file

@ -65,7 +65,7 @@ cat $V_DNSTPL/$template.tpl |\
-e "s/%domain_idn%/$domain_idn/g" \
-e "s/%domain%/$domain/g" \
-e "s/%ns1%/$ns1/g" \
-e "s/%ns2%/$ns2/g" > $V_USERS/$user/zones/$domain
-e "s/%ns2%/$ns2/g" > $V_USERS/$user/dns/$domain
# Updating zone
update_domain_zone

View file

@ -49,7 +49,7 @@ is_dns_record_valid
#----------------------------------------------------------#
# Deleting record
conf="$V_USERS/$user/zones/$domain"
conf="$V_USERS/$user/dns/$domain"
rm_string=$(grep -n "^ID='$id'" $conf|cut -d : -f 1)
if [ ! -z "$rm_string" ]; then
sed -i "$rm_string d" $conf

View file

@ -118,7 +118,7 @@ is_dns_domain_valid
#----------------------------------------------------------#
# Defining config
conf=$V_USERS/$user/zones/$domain
conf=$V_USERS/$user/dns/$domain
# Defining fileds to select
fields='$ID $RECORD $TYPE $VALUE $SUSPEND $DATE'

View file

@ -40,10 +40,10 @@ is_user_suspended
# Action #
#----------------------------------------------------------#
# Checking zones folder
if [ ! -d "$V_USERS/$user/zones" ]; then
rm -f $V_USERS/$user/zones
mkdir $V_USERS/$user/zones
# Checking dns folder
if [ ! -d "$V_USERS/$user/dns" ]; then
rm -f $V_USERS/$user/dns
mkdir $V_USERS/$user/dns
fi
# Defining config
@ -79,7 +79,7 @@ for domain in $domains; do
suspend="$(get_dns_domain_value '$SUSPEND')"
# Checking zone file
if [ ! -e "$V_USERS/$user/zones/$domain" ]; then
if [ ! -e "$V_USERS/$user/dns/$domain" ]; then
cat $V_DNSTPL/$template.tpl |\
sed -e "s/%ip%/$ip/g" \
-e "s/%domain_idn%/$domain_idn/g" \
@ -92,7 +92,7 @@ for domain in $domains; do
-e "s/%ns6%/$ns6/g" \
-e "s/%ns7%/$ns7/g" \
-e "s/%ns8%/$ns8/g" \
-e "s/%date%/$V_DATE/g" > $V_USERS/$user/zones/$domain
-e "s/%date%/$V_DATE/g" > $V_USERS/$user/dns/$domain
fi
# Sorting records

View file

@ -188,13 +188,13 @@ update_domain_zone() {
RECORD=$(idn --quiet -a -t "$RECORD")
VALUE=$(idn --quiet -a -t "$VALUE")
eval echo -e "\"$fields\""|sed -e "s/%quote%/'/g" >> $conf
done < $V_USERS/$user/zones/$domain
done < $V_USERS/$user/dns/$domain
}
get_next_dns_record() {
# Parsing config
curr_str=$(grep "ID=" $V_USERS/$user/zones/$domain|cut -f 2 -d \'|\
curr_str=$(grep "ID=" $V_USERS/$user/dns/$domain|cut -f 2 -d \'|\
sort -n|tail -n1)
# Print result
@ -203,7 +203,7 @@ get_next_dns_record() {
is_dns_record_free() {
# Checking record id
check_id=$(grep "ID='$id'" $V_USERS/$user/zones/$domain)
check_id=$(grep "ID='$id'" $V_USERS/$user/dns/$domain)
if [ ! -z "$check_id" ]; then
echo "Error: ID exist"
@ -214,7 +214,7 @@ is_dns_record_free() {
sort_dns_records() {
# Defining conf
conf="$V_USERS/$user/zones/$domain"
conf="$V_USERS/$user/dns/$domain"
cat $conf |sort -n -k 2 -t \' >$conf.tmp
mv -f $conf.tmp $conf
}
@ -460,7 +460,7 @@ is_web_domain_cert_valid() {
is_dns_record_valid() {
# Checking record id
check_id=$(grep "^ID='$id'" $V_USERS/$user/zones/$domain)
check_id=$(grep "^ID='$id'" $V_USERS/$user/dns/$domain)
if [ -z "$check_id" ]; then
echo "Error: ID not exist"
@ -533,7 +533,7 @@ del_dns_domain() {
exit $E_PARSE_ERROR
fi
sed -i "$string d" $conf
rm -f $V_USERS/$user/zones/$domain
rm -f $V_USERS/$user/dns/$domain
}
del_web_domain() {