Browse Source

Merge branch 'fix/2020-10_upgrade-rebuild' into staging/fixes

Kristan Kenney 5 years ago
parent
commit
ebe83a5bae
3 changed files with 17 additions and 13 deletions
  1. 8 6
      bin/v-update-mail-templates
  2. 7 5
      bin/v-update-web-templates
  3. 2 2
      func/upgrade.sh

+ 8 - 6
bin/v-update-mail-templates

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: update mail templates
-# options: [RESTART]
+# options: [RESTART] [SKIP]
 #
 # The function for obtaining updated pack of mail templates.
 
@@ -11,6 +11,7 @@
 
 # Argument definition
 restart=$1
+skip=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -24,12 +25,13 @@ 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 $MAIL_SYSTEM ]; then
-	for user in $($HESTIA/bin/v-list-sys-users plain); do
-		$BIN/v-rebuild-mail-domains $user no
-	done
+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
+		done
+	fi
 fi
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 7 - 5
bin/v-update-web-templates

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: update web templates
-# options: [RESTART]
+# options: [RESTART] [SKIP]
 #
 # The function for obtaining updated pack of web templates.
 
@@ -11,6 +11,7 @@
 
 # Argument definition
 restart=$1
+skip=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -43,10 +44,11 @@ for php_ver in $(ls /etc/php/); do
 done
 
 # Rebuilding web domains
-for user in $($BIN/v-list-sys-users plain); do
-    $BIN/v-rebuild-web-domains $user no
-done
-
+if [ ! -z "$skip" ]; then
+    for user in $($BIN/v-list-sys-users plain); do
+        $BIN/v-rebuild-web-domains $user no
+    done
+fi
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 2 - 2
func/upgrade.sh

@@ -609,14 +609,14 @@ upgrade_filemanager_update_config() {
 upgrade_rebuild_web_templates() {
     if [ "$UPGRADE_UPDATE_WEB_TEMPLATES" = "true" ]; then
         echo "[ ! ] Updating default web domain templates..."
-        $BIN/v-update-web-templates
+        $BIN/v-update-web-templates "no" "skip"
     fi
 }
 
 upgrade_rebuild_mail_templates() {
     if [ "$UPGRADE_UPDATE_MAIL_TEMPLATES" = "true" ]; then
         echo "[ ! ] Updating default mail domain templates..."
-        $BIN/v-update-mail-templates
+        $BIN/v-update-mail-templates "no" "skip"
     fi
 }