Browse Source

Fixes to upgrade procedures

Kristan Kenney 6 years ago
parent
commit
7a3170253b
2 changed files with 19 additions and 4 deletions
  1. 12 2
      func/upgrade.sh
  2. 7 2
      src/deb/hestia/postinst

+ 12 - 2
func/upgrade.sh

@@ -66,6 +66,11 @@ upgrade_init_backup() {
     mkdir -p $HESTIA_BACKUP/templates/
     mkdir -p $HESTIA_BACKUP/templates/
 }
 }
 
 
+upgrade_refresh_config() {
+    source /usr/local/hestia/conf/hestia.conf
+    source /usr/local/hestia/func/main.sh
+}
+
 upgrade_start_routine() {
 upgrade_start_routine() {
     #####################################################################
     #####################################################################
     #######       Ensure that release branch variable exists      #######
     #######       Ensure that release branch variable exists      #######
@@ -88,8 +93,9 @@ upgrade_start_routine() {
         source $HESTIA/install/upgrade/versions/previous/1.00.0-190618.sh
         source $HESTIA/install/upgrade/versions/previous/1.00.0-190618.sh
         source $HESTIA/install/upgrade/versions/previous/1.0.1.sh
         source $HESTIA/install/upgrade/versions/previous/1.0.1.sh
         VERSION="1.0.1"
         VERSION="1.0.1"
+        upgrade_refresh_config
     fi
     fi
-
+    
     #####################################################################
     #####################################################################
     #######             Start standard upgrade process            #######
     #######             Start standard upgrade process            #######
     #######  Place instructions for all post v1.0.1 builds below  #######
     #######  Place instructions for all post v1.0.1 builds below  #######
@@ -102,18 +108,21 @@ upgrade_start_routine() {
         echo ""
         echo ""
         source $HESTIA/install/upgrade/versions/latest.sh
         source $HESTIA/install/upgrade/versions/latest.sh
         VERSION="$new_version"
         VERSION="$new_version"
+        upgrade_refresh_config
     fi
     fi
 
 
     # Upgrade to Version 1.0.2
     # Upgrade to Version 1.0.2
     if [ $VERSION = "1.0.1" ]; then
     if [ $VERSION = "1.0.1" ]; then
         source $HESTIA/install/upgrade/versions/previous/1.0.2.sh
         source $HESTIA/install/upgrade/versions/previous/1.0.2.sh
         VERSION="1.0.2"
         VERSION="1.0.2"
+        upgrade_refresh_config
     fi
     fi
 
 
     # Upgrade to Version 1.0.3
     # Upgrade to Version 1.0.3
     if [ $VERSION = "1.0.2" ]; then
     if [ $VERSION = "1.0.2" ]; then
         source $HESTIA/install/upgrade/versions/latest.sh
         source $HESTIA/install/upgrade/versions/latest.sh
         VERSION="$new_version"
         VERSION="$new_version"
+        upgrade_refresh_config
     fi
     fi
 
 
     #####################################################################
     #####################################################################
@@ -220,4 +229,5 @@ upgrade_restart_services() {
     # Restart SSH daemon and Hestia Control Panel service
     # Restart SSH daemon and Hestia Control Panel service
     $BIN/v-restart-service ssh $restart
     $BIN/v-restart-service ssh $restart
     $BIN/v-restart-service hestia $restart
     $BIN/v-restart-service hestia $restart
-}
+}
+

+ 7 - 2
src/deb/hestia/postinst

@@ -1,11 +1,16 @@
 #!/bin/bash
 #!/bin/bash
 
 
+if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
+    exit
+fi
+
 ###############################################################
 ###############################################################
 #                Initialize functions/variables               #
 #                Initialize functions/variables               #
 ###############################################################
 ###############################################################
-source /usr/local/hestia/conf/hestia.conf
-source /usr/local/hestia/func/main.sh
+
+# Load upgrade functions and refresh variables/configuration
 source /usr/local/hestia/func/upgrade.sh
 source /usr/local/hestia/func/upgrade.sh
+upgrade_refresh_config
 
 
 ###############################################################
 ###############################################################
 #             Set new version numbers for packages            #
 #             Set new version numbers for packages            #