Browse Source

Fix/2021 03 fix rebuild when updating templates (#1664)

* Fix issue with rebuil users after v-update-{task]-templates

* Add tabbing
Jaap Marcus 5 years ago
parent
commit
805d270f32
2 changed files with 18 additions and 15 deletions
  1. 9 7
      bin/v-update-mail-templates
  2. 9 8
      bin/v-update-web-templates

+ 9 - 7
bin/v-update-mail-templates

@@ -28,7 +28,7 @@ source $HESTIA/conf/hestia.conf
 cp -rf $HESTIA_INSTALL_DIR/templates/mail $HESTIA/data/templates/
 
 # Rebuild mail domains if mail services are enabled
-if [ ! -z "$skip" ]; then
+if [ -z "$skip" ]; then
 	if [ ! -z $MAIL_SYSTEM ]; then
 		for user in $($HESTIA/bin/v-list-sys-users plain); do
 			$BIN/v-rebuild-mail-domains $user no
@@ -39,11 +39,13 @@ fi
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-# Restarting web server
-$BIN/v-restart-web $restart
-check_result $? "restart" >/dev/null 2>&1
-
-$BIN/v-restart-proxy $restart
-check_result $? "restart" >/dev/null 2>&1
+if [ ! -z "$restart" ] || [ "$restart" == "yes" ]; then
+    # Restarting web server
+    $BIN/v-restart-web $restart
+    check_result $? "restart" >/dev/null 2>&1
+    
+    $BIN/v-restart-proxy $restart
+    check_result $? "restart" >/dev/null 2>&1
+fi
 
 exit

+ 9 - 8
bin/v-update-web-templates

@@ -47,7 +47,7 @@ for php_ver in $(ls /etc/php/); do
 done
 
 # Rebuilding web domains
-if [ ! -z "$skip" ]; then
+if [  -z "$skip" ]; then
     for user in $($BIN/v-list-sys-users plain); do
         $BIN/v-rebuild-web-domains $user no
     done
@@ -57,11 +57,12 @@ fi
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-# Restarting web server
-$BIN/v-restart-web $restart
-check_result $? "restart" >/dev/null 2>&1
-
-$BIN/v-restart-proxy $restart
-check_result $? "restart" >/dev/null 2>&1
-
+if [ ! -z "$restart" ] || [ "$restart" == "yes" ]; then
+    # Restarting web server
+    $BIN/v-restart-web $restart
+    check_result $? "restart" >/dev/null 2>&1
+    
+    $BIN/v-restart-proxy $restart
+    check_result $? "restart" >/dev/null 2>&1
+fi 
 exit