Browse Source

Fixes to upgrade scripts

Kristan Kenney 6 years ago
parent
commit
df10d4d6ea

+ 5 - 1
install/upgrade/versions/latest.sh

@@ -6,6 +6,10 @@
 #######                      Place additional commands below.                   #######
 #######################################################################################
 
+# Reload hestia.conf and main functions for this upgrade to ensure new variables are set
+source $HESTIA/conf/hestia.conf
+source $HESTIA/func/main.sh
+
 # Set default theme
 if [ -z $THEME ]; then
     echo "(*) Enabling support for themes..."
@@ -57,7 +61,7 @@ if [ ! -z "$WEBALIZER_CHECK" ]; then
     if [ -d "/var/www/webalizer" ]; then
         rm -rf /var/www/webalizer
     fi
-    sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
+    $BIN/v-change-sys-config-value 'STATS_SYSTEM' "awstats"
 fi
 
 # Remove old hestia.conf files from Apache & NGINX if they exist

+ 1 - 2
install/upgrade/versions/previous/1.0.1.sh

@@ -9,8 +9,7 @@
 # Ensure that users from previous releases are set to the correct stable release branch
 if [ ! -z "$RELEASE_BRANCH" ] && [ "$RELEASE_BRANCH" = "master" ] || [ "$RELEASE_BRANCH" = "develop" ]; then
     echo "(*) Updating default release branch configuration..."
-    sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
-    echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
+    $BIN/v-change-sys-config-value 'RELEASE_BRANCH' "release"
 fi
 
 # Back up old template files and install the latest versions

+ 1 - 2
install/upgrade/versions/previous/1.00.0-190618.sh

@@ -10,8 +10,7 @@
 WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
 if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
     echo "(*) Adding global webmail alias to system configuration..."
-    sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
-    echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
+    $BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' "webmail"
 fi
 
 # Update Apache and Nginx configuration to support new file structure