Skip to content

Commit 5e6ad34

Browse files
committed
check only for exmpty config values
1 parent 2bbeea6 commit 5e6ad34

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

bin/v-add-domain

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ source $VESTA/conf/vesta.conf
2424
#----------------------------------------------------------#
2525
# Verifications #
2626
#----------------------------------------------------------#
27-
2827
check_args '2' "$#" 'USER DOMAIN [IP] [RESTART]'
2928
validate_format 'user' 'domain'
3029
if [ ! -z "$ip" ] ; then
@@ -49,14 +48,12 @@ if [ -z "$ip" ]; then
4948
fi
5049

5150
# Web domain
52-
# Do Not restart at this point, will loose connection from API calls
53-
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
51+
if [ ! -z "$WEB_SYSTEM" ]; then
5452
$BIN/v-add-web-domain $user $domain $ip 'no'
5553
return_code=$?
5654
fi
5755

5856
# Proxy support
59-
# Do Not restart at this point, will loose connection from API calls
6057
if [ ! -z "$PROXY_SYSTEM" ] && [ "$return_code" -eq 0 ]; then
6158
extentions="jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls"
6259
extentions="$extentions,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav"
@@ -65,19 +62,15 @@ if [ ! -z "$PROXY_SYSTEM" ] && [ "$return_code" -eq 0 ]; then
6562
fi
6663

6764
# DNS domain
68-
if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then
69-
if [ "$return_code" -eq 0 ]; then
70-
$BIN/v-add-dns-domain $user $domain $ip 'no'
71-
return_code=$?
72-
fi
65+
if [ ! -z "$DNS_SYSTEM" ] && [ "$return_code" -eq 0 ]; then
66+
$BIN/v-add-dns-domain $user $domain $ip 'no'
67+
return_code=$?
7368
fi
7469

7570
# Mail domain
76-
if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then
77-
if [ "$return_code" -eq 0 ]; then
78-
$BIN/v-add-mail-domain $user $domain
79-
return_code=$?
80-
fi
71+
if [ ! -z "$MAIL_SYSTEM" ] && [ "$return_code" -eq 0 ]; then
72+
$BIN/v-add-mail-domain $user $domain
73+
return_code=$?
8174
fi
8275

8376
# Restart services

0 commit comments

Comments
 (0)