From add6ebe952e14ab3ecead41486b5a6d026d30a58 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Nov 2011 14:02:00 +0200 Subject: [PATCH] renamed zones folder to dns --- bin/v_add_dns_domain | 4 ++-- bin/v_add_dns_domain_record | 2 +- bin/v_add_sys_user | 2 +- bin/v_change_dns_domain_ip | 2 +- bin/v_change_dns_domain_record | 2 +- bin/v_change_dns_domain_tpl | 2 +- bin/v_del_dns_domain_record | 2 +- bin/v_list_dns_domain | 2 +- bin/v_rebuild_dns_domains | 12 ++++++------ func/domain.func | 12 ++++++------ 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bin/v_add_dns_domain b/bin/v_add_dns_domain index 33e7df2df..44341447b 100755 --- a/bin/v_add_dns_domain +++ b/bin/v_add_dns_domain @@ -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'" diff --git a/bin/v_add_dns_domain_record b/bin/v_add_dns_domain_record index 77f8aef84..a6c067894 100755 --- a/bin/v_add_dns_domain_record +++ b/bin/v_add_dns_domain_record @@ -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'" diff --git a/bin/v_add_sys_user b/bin/v_add_sys_user index b4c62c0a7..8b800a26f 100755 --- a/bin/v_add_sys_user +++ b/bin/v_add_sys_user @@ -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 diff --git a/bin/v_change_dns_domain_ip b/bin/v_change_dns_domain_ip index b7e0aaa53..3805012e0 100755 --- a/bin/v_change_dns_domain_ip +++ b/bin/v_change_dns_domain_ip @@ -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 diff --git a/bin/v_change_dns_domain_record b/bin/v_change_dns_domain_record index 65a42183f..ed9fe8d50 100755 --- a/bin/v_change_dns_domain_record +++ b/bin/v_change_dns_domain_record @@ -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) diff --git a/bin/v_change_dns_domain_tpl b/bin/v_change_dns_domain_tpl index 3deef7006..6fef6b12b 100755 --- a/bin/v_change_dns_domain_tpl +++ b/bin/v_change_dns_domain_tpl @@ -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 diff --git a/bin/v_del_dns_domain_record b/bin/v_del_dns_domain_record index 835e32cac..68162f504 100755 --- a/bin/v_del_dns_domain_record +++ b/bin/v_del_dns_domain_record @@ -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 diff --git a/bin/v_list_dns_domain b/bin/v_list_dns_domain index ff5e0f931..a087b1960 100755 --- a/bin/v_list_dns_domain +++ b/bin/v_list_dns_domain @@ -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' diff --git a/bin/v_rebuild_dns_domains b/bin/v_rebuild_dns_domains index e207259b2..e0064f0be 100755 --- a/bin/v_rebuild_dns_domains +++ b/bin/v_rebuild_dns_domains @@ -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 diff --git a/func/domain.func b/func/domain.func index 75edd0d71..5a54fb8c2 100644 --- a/func/domain.func +++ b/func/domain.func @@ -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() {