Permalink
Browse files

fix for broken unsuspend

  • Loading branch information...
serghey-rodin committed Feb 26, 2013
1 parent c1ca42b commit 5a73b73b3b69aeae488f2308817bf6e1b85a02dc
Showing with 9 additions and 5 deletions.
  1. +5 −2 bin/v-rebuild-dns-domains
  2. +4 −3 bin/v-unsuspend-dns-domain
@@ -56,6 +56,9 @@ for nameserver in ${ns//,/ };do
i=$((i + 1))
done
# Remove old user's zone
sed -i "/\/$user\/conf\/dns/d" /etc/named.conf
# Starting loop
for domain in $(search_objects 'dns' 'DOMAIN' "*" 'DOMAIN'); do
# Defining variables
@@ -89,13 +92,13 @@ for domain in $(search_objects 'dns' 'DOMAIN' "*" 'DOMAIN'); do
# Bind config check
nconf='/etc/named.conf'
if [ "$SUSPENDED" = 'yes' ]; then
rm_string=$(grep -n /etc/namedb/$domain.db $nconf | cut -d : -f 1)
rm_string=$(grep -n /etc/namedb/$domain.db $nconf | cut -d : -f 1)
if [ ! -z "$rm_string" ]; then
sed -i "$rm_string d" $nconf
fi
suspended_dns=$((suspended_dns + 1))
else
if [ -z "$(grep /$domain.db $nconf)" ]; then
if [ -z "$(grep /$domain.db $nconf)" ]; then
named="zone \"$domain_idn\" {type master; file"
named="$named \"$HOMEDIR/$user/conf/dns/$domain.db\";};"
echo "$named" >> /etc/named.conf
@@ -37,9 +37,10 @@ is_object_suspended 'dns' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Adding zone in named.conf
named="zone \"$domain_idn\" {type master; file"
named="$named \"$HOMEDIR/$user/conf/dns/$domain.db\";};"
echo "$named" >> /etc/named.conf
#named="zone \"$domain_idn\" {type master; file"
#named="$named \"$HOMEDIR/$user/conf/dns/$domain.db\";};"
#echo "$named" >> /etc/named.conf
#----------------------------------------------------------#
# Vesta #

0 comments on commit 5a73b73

Please sign in to comment.