Browse Source

Add additional shims to 0.9.8-28.sh

* Create data backup directory
* Load hestia.conf during upgrade
* Fix default page template permissions
Kristan Kenney 7 years ago
parent
commit
0b5e021290
1 changed files with 24 additions and 10 deletions
  1. 24 10
      install/upgrade/0.9.8-28.sh

+ 24 - 10
install/upgrade/0.9.8-28.sh

@@ -1,8 +1,20 @@
 #!/bin/bash
 #!/bin/bash
+HESTIA="/usr/local/hestia"
+HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+
+# load hestia.conf
+source $HESTIA/conf/hestia.conf
 
 
 # Set version(s)
 # Set version(s)
 pma_v='4.8.5'
 pma_v='4.8.5'
 
 
+# Initialize backup directory
+mkdir -p $HESTIA_BACKUP/templates/
+mkdir -p $HESTIA_BACKUP/packages/
+
+# load hestia main functions
+source /usr/local/hestia/func/main.sh
+
 # Upgrade phpMyAdmin
 # Upgrade phpMyAdmin
 if [ "$DB_SYSTEM" = 'mysql' ]; then
 if [ "$DB_SYSTEM" = 'mysql' ]; then
     # Display upgrade information
     # Display upgrade information
@@ -58,7 +70,6 @@ if [ ! -z "$BACKEND_PORT" ]; then
     /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
     /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
 fi
 fi
 
 
-
 # Update default page templates
 # Update default page templates
 echo '************************************************************************'
 echo '************************************************************************'
 echo "Replacing default templates and packages...                             "
 echo "Replacing default templates and packages...                             "
@@ -76,8 +87,6 @@ if [ -d $HESTIA/data/templates/ ]; then
     cp -rf $HESTIA/data/templates $HESTIA_BACKUP/
     cp -rf $HESTIA/data/templates $HESTIA_BACKUP/
     $HESTIA/bin/v-update-web-templates
     $HESTIA/bin/v-update-web-templates
     $HESTIA/bin/v-update-dns-templates
     $HESTIA/bin/v-update-dns-templates
-    $HESTIA/bin/v-update-mail-templates
-    $HESTIA/bin/v-update-sys-packages
 fi
 fi
 
 
 # Remove old Office 365 template as there is a newer version with an updated name
 # Remove old Office 365 template as there is a newer version with an updated name
@@ -150,12 +159,12 @@ if [ -f /etc/roundcube/main.inc.php ]; then
     sed -i "s/\['flag_for_deletion'] = 'Purge';/\['flag_for_deletion'] = false;/gI" /etc/roundcube/main.inc.php
     sed -i "s/\['flag_for_deletion'] = 'Purge';/\['flag_for_deletion'] = false;/gI" /etc/roundcube/main.inc.php
 fi
 fi
 
 
-# Copy default "Success" page for unassigned hosts
-cp -rf /usr/local/hestia/install/ubuntu/18.04/templates/web/unassigned/* /var/www/
-
-# Move clamav to proper location - https://goo.gl/zNuM11
-if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
-    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
+# Remove old OS-specific installation files if they exist to free up space
+if [ -d $HESTIA/install/ubuntu ]; then
+    rm -rf $HESTIA/install/ubuntu
+fi
+if [ -d $HESTIA/install/debian ]; then
+    rm -rf $HESTIA/install/debian
 fi
 fi
 
 
 # Fix dovecot configuration
 # Fix dovecot configuration
@@ -172,4 +181,9 @@ fi
 # Rebuild mailboxes
 # Rebuild mailboxes
 for user in `ls /usr/local/hestia/data/users/`; do
 for user in `ls /usr/local/hestia/data/users/`; do
     v-rebuild-mail-domains $user
     v-rebuild-mail-domains $user
-done
+done
+
+# Move clamav to proper location - https://goo.gl/zNuM11
+if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
+    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
+fi