File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 102102# Add configuration file
103103cp -f $HESTIA_INSTALL_DIR /filemanager/filegator/configuration.php $HESTIA /web/fm/configuration.php
104104
105+ # Path to the file manager configuration file where the change will be made.
106+ config_file=" $HESTIA /web/fm/configuration.php"
107+ app_name=" File Manager - $APP_NAME "
108+
109+ # Sed replaces only the value after "File Manager -"
110+ sed -i " s|\(\$ dist_config\[\" frontend_config\" \]\[\" app_name\" \] = \" File Manager - \).*\" ;|\1${APP_NAME} \" ;|" " $config_file "
111+
105112echo " $fm_v " > " ${FM_INSTALL_DIR} /version"
106113# Set permissions
107114chown root: -R " ${FM_INSTALL_DIR} "
Original file line number Diff line number Diff line change @@ -45,6 +45,19 @@ mv $HESTIA/conf/hestia.conf $HESTIA/conf/hestia.conf.bak
4545mv /tmp/updconf $HESTIA /conf/hestia.conf
4646rm -f $HESTIA /conf/hestia.conf.bak
4747
48+ # Check if the variable "$key" has the value "APP_NAME"
49+ if [ " $key " == " APP_NAME" ]; then
50+ # Path to the file manager configuration file where the change will be made.
51+ config_file=" $HESTIA /web/fm/configuration.php"
52+ new_app_name=" File Manager - $value "
53+
54+ # Verify if configuration.php exists and is writable
55+ if [ -f " $config_file " ] && [ -w " $config_file " ]; then
56+ # Sed replaces only the value after "File Manager -"
57+ sed -i " s|\(\$ dist_config\[\" frontend_config\" \]\[\" app_name\" \] = \" File Manager - \).*\" ;|\1${value} \" ;|" " $config_file "
58+ fi
59+ fi
60+
4861# ----------------------------------------------------------#
4962# Hestia #
5063# ----------------------------------------------------------#
Original file line number Diff line number Diff line change @@ -687,6 +687,14 @@ upgrade_filemanager() {
687687 echo " [ ! ] Updating File Manager configuration..."
688688 # Update configuration.php
689689 cp -f $HESTIA_INSTALL_DIR /filemanager/filegator/configuration.php $HESTIA /web/fm/configuration.php
690+
691+ # Path to the file manager configuration file where the change will be made.
692+ config_file=" $HESTIA /web/fm/configuration.php"
693+ app_name=" File Manager - $APP_NAME "
694+
695+ # Sed replaces only the value after "File Manager -"
696+ sed -i " s|\(\$ dist_config\[\" frontend_config\" \]\[\" app_name\" \] = \" File Manager - \).*\" ;|\1${APP_NAME} \" ;|" " $config_file "
697+
690698 # Set environment variable for interface
691699 $BIN /v-change-sys-config-value ' FILE_MANAGER' ' true'
692700 fi
You can’t perform that action at this time.
0 commit comments