Просмотр исходного кода

#1236 Improve restart behavoir v-add-domain.com (#3020)

* Fix restart issues

* Set v-add-mail-domain to no
Jaap Marcus 3 лет назад
Родитель
Сommit
87b3674457
2 измененных файлов с 8 добавлено и 8 удалено
  1. 2 2
      bin/v-add-domain
  2. 6 6
      bin/v-add-mail-domain

+ 2 - 2
bin/v-add-domain

@@ -14,7 +14,7 @@
 user=$1
 domain=$2
 ip=$3
-restart="${4-yes}"
+restart=$4
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -66,7 +66,7 @@ fi
 
 # Working on mail domain
 if [ -n "$MAIL_SYSTEM" ]; then
-    $BIN/v-add-mail-domain $user $domain
+    $BIN/v-add-mail-domain $user $domain 'no'
     check_result $? "can't add mail domain" >/dev/null
 fi
 

+ 6 - 6
bin/v-add-mail-domain

@@ -17,7 +17,7 @@ antispam=${3-yes}
 antivirus=${4-yes}
 dkim=${5-yes}
 dkim_size=${6-1024}
-restart=${7-yes}
+restart="$7"
 reject=${8-no}
 
 # Includes
@@ -65,7 +65,7 @@ else
     is_domain_new 'mail' "$domain"
 fi
 if [ -z "$(is_ip_format_valid $domain)" ]; then
-    echo "Error: Invalid domain format. IP address detected as input." 
+    echo "Error: Invalid domain format. IP address detected as input."
     exit 1
 fi
 
@@ -129,8 +129,8 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     if [ -n "$local_ip" ]; then
         echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
     fi
-    
-    if [ -n "$ANTISPAM_SYSTEM" ]; then 
+
+    if [ -n "$ANTISPAM_SYSTEM" ]; then
         # Adding antispam protection
         if [ "$antispam" = 'yes' ]; then
             touch "$HOMEDIR/$user/conf/mail/$domain/antispam"
@@ -139,7 +139,7 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
             touch "$HOMEDIR/$user/conf/mail/$domain/reject_spam"
         fi
     fi
-    
+
     if [ -n "$ANTIVIRUS_SYSTEM" ]; then
         # Adding antivirus protection
         if [ "$antivirus" = 'yes' ]; then
@@ -189,7 +189,7 @@ if [ -n "$WEB_SYSTEM" ] || [ -n "$PROXY_SYSTEM" ]; then
         $BIN/v-add-mail-domain-webmail "$user" "$domain" '' 'no'
     fi
 fi
-    
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#