Skip to content

Commit 19cdf5f

Browse files
author
Serghey Rodin
committed
check if dns-sync is already running
1 parent 502749a commit 19cdf5f

11 files changed

+22
-56
lines changed

bin/v-add-remote-dns-domain

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ user=$1
1414
domain=$2
1515
flush=$3
1616

17+
1718
# Includes
1819
source $VESTA/func/main.sh
1920
source $VESTA/func/remote.sh
@@ -27,12 +28,7 @@ source $VESTA/conf/vesta.conf
2728
check_args '2' "$#" 'USER DOMAIN [FLUSH]'
2829
is_format_valid 'user' 'domain'
2930
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
30-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
31-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
32-
fi
33-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
34-
check_result $E_EXISTS "another sync process already running"
35-
fi
31+
is_procces_running
3632
remote_dns_health_check
3733

3834

bin/v-add-remote-dns-record

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ is_format_valid 'user' 'domain' 'id'
2929
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
3030
is_object_valid 'user' 'USER' "$user"
3131
is_object_valid 'dns' 'DOMAIN' "$domain"
32-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
33-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
34-
fi
35-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
36-
check_result $E_EXISTS "another sync process already running"
37-
fi
32+
is_procces_running
3833
remote_dns_health_check
3934

4035

bin/v-add-web-domain-proxy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
# Argument definition
1414
user=$1
15-
domain=$(idn -t --quiet -u "$2" )
16-
domain_idn=$(idn -t --quiet -a "$domain")
15+
domain=$2
1716
template=$3
1817
default_extentions="jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,\
1918
exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm"
@@ -51,6 +50,7 @@ is_proxy_template_valid $template
5150

5251
# Defining domain parameters
5352
get_domain_values 'web'
53+
prepare_web_domain_values
5454
local_ip=$(get_real_ip $IP)
5555

5656
# Preparing domain values for the template substitution

bin/v-change-remote-dns-domain-exp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ is_format_valid 'user' 'domain'
2828
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
2929
is_object_valid 'user' 'USER' "$user"
3030
is_object_valid 'dns' 'DOMAIN' "$domain"
31-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
32-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
33-
fi
34-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
35-
check_result $E_EXISTS "another sync process already running"
36-
fi
31+
is_procces_running
3732
remote_dns_health_check
3833

3934

bin/v-change-remote-dns-domain-soa

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ is_format_valid 'user' 'domain'
2828
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
2929
is_object_valid 'user' 'USER' "$user"
3030
is_object_valid 'dns' 'DOMAIN' "$domain"
31-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
32-
check_result 1 $E_NOTEXIST "dns-cluster.conf doesn't exist"
33-
fi
34-
if [ "$(ps auxf |grep -v grep |grep $VESTA/bin/$SCRIPT |wc -l)" -gt 2 ]; then
35-
check_result 1 $E_EXISTS "another sync process already running"
36-
fi
31+
is_procces_running
3732
remote_dns_health_check
3833

3934

bin/v-change-remote-dns-domain-ttl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ is_format_valid 'user' 'domain'
2828
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
2929
is_object_valid 'user' 'USER' "$user"
3030
is_object_valid 'dns' 'DOMAIN' "$domain"
31-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
32-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
33-
fi
34-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
35-
check_result $E_EXISTS "another sync process already running"
36-
fi
31+
is_procces_running
3732
remote_dns_health_check
3833

3934

bin/v-delete-remote-dns-domain

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ source $VESTA/conf/vesta.conf
2626
check_args '2' "$#" 'USER DOMAIN'
2727
is_format_valid 'user' 'domain'
2828
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
29-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
30-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
31-
fi
32-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
33-
check_result $E_EXISTS "another sync process already running"
34-
fi
29+
is_procces_running
3530
remote_dns_health_check
3631

3732

bin/v-delete-remote-dns-domains

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ source $VESTA/conf/vesta.conf
2222
#----------------------------------------------------------#
2323

2424
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
25-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
26-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
27-
fi
28-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
29-
check_result $E_EXISTS "another sync process already running"
30-
fi
25+
is_procces_running
3126
remote_dns_health_check
3227

3328

bin/v-delete-remote-dns-record

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ source $VESTA/conf/vesta.conf
2727
check_args '3' "$#" 'USER DOMAIN ID'
2828
is_format_valid 'user' 'domain' 'id'
2929
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
30-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
31-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
32-
fi
33-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
34-
check_result $E_EXISTS "another sync process already running"
35-
fi
30+
is_procces_running
3631
remote_dns_health_check
3732

3833

bin/v-sync-dns-cluster

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ source $VESTA/conf/vesta.conf
2222
#----------------------------------------------------------#
2323

2424
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
25-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
26-
check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
27-
fi
28-
if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
29-
check_result $E_EXISTS "another sync process already running"
30-
fi
25+
is_procces_running
3126
remote_dns_health_check 'no_email'
3227

3328

0 commit comments

Comments
 (0)