Skip to content

Commit 0f7c02e

Browse files
committed
skip nonexisting domains
1 parent d9dde85 commit 0f7c02e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/v-add-remote-dns-domain

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ source $VESTA/conf/vesta.conf
2626
check_args '2' "$#" 'USER DOMAIN'
2727
validate_format 'user' 'domain'
2828
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
29-
is_object_valid 'user' 'USER' "$user"
30-
is_object_valid 'dns' 'DOMAIN' "$domain"
3129

3230
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
3331
echo "Error: dns-cluster.conf doesn't exist"
@@ -47,6 +45,17 @@ fi
4745
# Action #
4846
#----------------------------------------------------------#
4947

48+
# Check domain existance
49+
check_local_domain=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf 2>/dev/null)
50+
if [ -z "$check_local_domain" ]; then
51+
pipe="$VESTA/data/queue/dns-cluster.pipe"
52+
str=$(grep -n "$SCRIPT $1 $2$" $pipe | cut -f1 -d: | head -n1)
53+
if [ ! -z "$str" ]; then
54+
sed -i "$str d" $pipe
55+
fi
56+
exit
57+
fi
58+
5059
old_ifs="$IFS"
5160
IFS=$'\n'
5261

0 commit comments

Comments
 (0)