@@ -25,31 +25,13 @@ FM_FILE="filegator_v${FM_V}.zip"
2525FM_URL=" https://github.com/filegator/filegator/releases/download/v${FM_V} /${FM_FILE} "
2626
2727
28- COMPOSER_DIR=" $HOMEDIR /$user /.composer"
29- COMPOSER_BIN=" $COMPOSER_DIR /composer"
30-
28+ COMPOSER_BIN=" $HOMEDIR /$user /.composer/composer"
3129if [ ! -f " $COMPOSER_BIN " ]; then
32- mkdir -p " $COMPOSER_DIR "
33- chown $user : " $COMPOSER_DIR "
34-
35- COMPOSER_SETUP_FILE=$( mktemp)
36- check_result $? " Create temp file"
37- chown $user : " $COMPOSER_SETUP_FILE "
38-
39- signature=" $( curl --silent --show-error https://composer.github.io/installer.sig) "
40- check_result $? " Download signature"
41-
42- user_exec wget --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache https://getcomposer.org/installer --quiet -O " $COMPOSER_SETUP_FILE "
43- check_result $? " Download composer installer"
44-
45- [[ " $signature " = $( sha384sum $COMPOSER_SETUP_FILE | cut -f 1 -d " " ) ]] || check_result $E_INVALID " Composer signature does not match"
46-
47- COMPOSER_HOME=" $HOMEDIR /$user /.config/composer" user_exec /usr/bin/php " $COMPOSER_SETUP_FILE " --quiet --install-dir=" $COMPOSER_DIR " --filename=composer
48- check_result $? " Composer install failed"
49-
50- [ -f " $COMPOSER_SETUP_FILE " ] && rm -f " $COMPOSER_SETUP_FILE "
30+ $BIN /v-add-user-composer " $user "
31+ check_result $? " Install composer failed"
5132fi
5233
34+ rm --recursive --force " $FM_INSTALL_DIR "
5335mkdir -p " $FM_INSTALL_DIR "
5436cd " $FM_INSTALL_DIR "
5537
@@ -59,6 +41,7 @@ cd "$FM_INSTALL_DIR"
5941unzip -qq " ${FM_INSTALL_DIR} /${FM_FILE} "
6042mv --force ${FM_INSTALL_DIR} /filegator/* " ${FM_INSTALL_DIR} "
6143rm --recursive --force ${FM_INSTALL_DIR} /filegator
44+ [[ -f " ${FM_INSTALL_DIR} /${FM_FILE} " ]] && rm " ${FM_INSTALL_DIR} /${FM_FILE} "
6245
6346cp --recursive --force ${HESTIA_INSTALL_DIR} /filemanager/filegator/* " ${FM_INSTALL_DIR} "
6447
0 commit comments