ソースを参照

Ensure File Manager configuration is updated on each upgrade

Kristan Kenney 5 年 前
コミット
78e7e60500
3 ファイル変更12 行追加7 行削除
  1. 8 1
      func/upgrade.sh
  2. 1 6
      install/upgrade/versions/latest.sh
  3. 3 0
      src/deb/hestia/postinst

+ 8 - 1
func/upgrade.sh

@@ -159,7 +159,7 @@ upgrade_start_routine() {
         upgrade_refresh_config
     fi
 
-    # Upgrade to Version 1.1.2
+    # Upgrade to Version 1.2.0
     if [ $VERSION = "1.1.1" ]; then
         source $HESTIA/install/upgrade/versions/latest.sh
         VERSION="$new_version"
@@ -214,6 +214,13 @@ upgrade_phpmyadmin() {
     fi
 }
 
+upgrade_fm_configuration() {
+    if [ -e "$HESTIA/web/fm/configuration.php" ]; then
+        echo "(*) Updating File Manager Configuration..."
+        cp -f $HESTIA_INSTALL_DIR/filemanager/filegator/configuration.php $HESTIA/web/fm/configuration.php
+    fi
+}
+
 upgrade_get_version() {
     # Retrieve new version number for Hestia Control Panel from .deb package
     new_version=$(dpkg -l | awk '$2=="hestia" { print $3 }')

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

@@ -134,14 +134,9 @@ fi
 
 # Install Filegator FileManager during upgrade
 if [ ! -e "$HESTIA/web/fm/configuration.php" ]; then
-    echo "(*) Configuring Filegator FileManager..."
-
+    echo "(*) Installing File Manager..."
     # Install the FileManager
     source $HESTIA_INSTALL_DIR/filemanager/install-fm.sh > /dev/null 2>&1
-else 
-    echo "(*) Update Filegator Configuration..."
-    # Update configuration.php
-    cp -f $HESTIA_INSTALL_DIR/filemanager/filegator/configuration.php $HESTIA/web/fm/configuration.php
 fi
 
 # Enable nginx module loading

+ 3 - 0
src/deb/hestia/postinst

@@ -37,6 +37,9 @@ upgrade_start_routine
 # Upgrade phpMyAdmin if applicable
 upgrade_phpmyadmin
 
+# Ensure that File Manager configuration is up-to-date
+upgrade_fm_configuration
+
 # Set new version number in hestia.conf
 upgrade_set_version