Просмотр исходного кода

Rework the upgrade routine to support different version changes.

Raphael Schneeberger 6 лет назад
Родитель
Сommit
e8a466be3f
2 измененных файлов с 37 добавлено и 0 удалено
  1. 11 0
      install/upgrade/1.00.0-190618.sh
  2. 26 0
      install/upgrade/1.00.0-190621.sh

+ 11 - 0
install/upgrade/1.00.0-190618.sh

@@ -12,6 +12,17 @@ HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
 # Set installation source folder
 # Set installation source folder
 hestiacp="$HESTIA/install/deb"
 hestiacp="$HESTIA/install/deb"
 
 
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf
+
+# Get hestia version
+version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+
+# Compare version for upgrade routine
+if [ "$version" != "0.9.8-28" ]; then
+    source $HESTIA/install/upgrade/0.9.8-28.sh
+fi
+
 # Set phpMyAdmin version for upgrade
 # Set phpMyAdmin version for upgrade
 pma_v='4.9.0.1'
 pma_v='4.9.0.1'
 
 

+ 26 - 0
install/upgrade/1.00.0-190621.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Define global variables
+if [ -z "$HESTIA" ] || [ ! -f "${HESTIA}/conf/hestia.conf" ]; then
+    export HESTIA="/usr/local/hestia"
+    export BIN="/usr/local/hestia/bin"
+fi
+
+# Set backup folder
+HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
+
+# Set installation source folder
+hestiacp="$HESTIA/install/deb"
+
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf
+
+# Get hestia version
+version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+
+# Compare version for upgrade routine
+if [ "$version" != "1.00.0-190618" ]; then
+    source $HESTIA/install/upgrade/1.00.0-190618.sh
+fi
+
+# Place additional commands below.