skip nonexisting domains

This commit is contained in:
Serghey Rodin 2013-11-01 23:20:01 +02:00
commit 0f7c02ee4e

View file

@ -26,8 +26,6 @@ source $VESTA/conf/vesta.conf
check_args '2' "$#" 'USER DOMAIN'
validate_format 'user' 'domain'
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'dns' 'DOMAIN' "$domain"
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
echo "Error: dns-cluster.conf doesn't exist"
@ -47,6 +45,17 @@ fi
# Action #
#----------------------------------------------------------#
# Check domain existance
check_local_domain=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf 2>/dev/null)
if [ -z "$check_local_domain" ]; then
pipe="$VESTA/data/queue/dns-cluster.pipe"
str=$(grep -n "$SCRIPT $1 $2$" $pipe | cut -f1 -d: | head -n1)
if [ ! -z "$str" ]; then
sed -i "$str d" $pipe
fi
exit
fi
old_ifs="$IFS"
IFS=$'\n'