Skip to content

Commit c4890d1

Browse files
committed
Adjust error handling for filemanager installation.
1 parent f7d2e10 commit c4890d1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

install/deb/filemanager/install-fm.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ FM_URL="https://github.com/filegator/filegator/releases/download/v${FM_V}/${FM_F
2828
COMPOSER_BIN="$HOMEDIR/$user/.composer/composer"
2929
if [ ! -f "$COMPOSER_BIN" ]; then
3030
$BIN/v-add-user-composer "$user"
31-
check_result $? "Install composer failed"
31+
if [ $? -ne 0 ]; then
32+
$BIN/v-add-user-notification admin 'Composer installation failed' 'The FileManager installation had to been aborted, please try to run the installation manualy: bash $HESTIA/install/deb/filemanager/install-fm.sh'
33+
exit 0
34+
fi
3235
fi
3336

3437
rm --recursive --force "$FM_INSTALL_DIR"
@@ -46,8 +49,18 @@ rm --recursive --force ${FM_INSTALL_DIR}/filegator
4649
cp --recursive --force ${HESTIA_INSTALL_DIR}/filemanager/filegator/* "${FM_INSTALL_DIR}"
4750

4851
chown $user: -R "${FM_INSTALL_DIR}"
49-
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php $COMPOSER_BIN --quiet --no-dev install
50-
check_result $? "Install filemanager dependency"
52+
53+
# Check if php7.3 is available and run the installer
54+
if [ -f "/usr/bin/php7.3" ]; then
55+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php7.3 $COMPOSER_BIN --quiet --no-dev install
56+
if [ $? -ne 0 ]; then
57+
$BIN/v-add-user-notification admin 'FM installation failed' 'The FileManager installation had to been aborted, please try to run the installation manualy: bash $HESTIA/install/deb/filemanager/install-fm.sh'
58+
exit 0
59+
fi
60+
else
61+
$BIN/v-add-user-notification admin 'FM installation failed' 'php7.3-cli is missing on your system, the FileManager installation had to been aborted - please check your php environment.'
62+
exit 0
63+
fi
5164

5265
chown root: -R "${FM_INSTALL_DIR}"
5366
chown $user: "${FM_INSTALL_DIR}/private"

0 commit comments

Comments
 (0)