diff --git a/upgrade_roundcube.sh b/upgrade_roundcube.sh index 23605f9..d922f4a 100755 --- a/upgrade_roundcube.sh +++ b/upgrade_roundcube.sh @@ -289,6 +289,29 @@ if [[ "$NEW_INSTALL_DIR" = "$CUR_INSTALL_DIR" ]] ; then fi +# - Determin PHP of all installed versions +# - +if $PHP_DEBIAN_INSTALLATION ; then + echononl " Get get major version installed PHP" + php_major_version="$(php --version | head -1 | cut -d' ' -f2 | cut -d '-' -f1 | cut -d'.' -f1,2)" + if [[ -z "$php_major_version" ]]; then + echo_failed + error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!" + else + echo_ok + fi +else + echononl " Get major version of all installed PHP versions" + IFS=$'\n' php_major_versions="$(find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort)" + if [[ -z "$php_major_versions" ]]; then + echo_failed + error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!" + else + echo_ok + fi +fi + + echo "" echo "" echo -e "\033[1;32mSettings for upgrading \033[1;37mRoundcube Webmail\033[m" @@ -325,6 +348,22 @@ if [[ "$DB_TYPE" = "mysql" ]]; then echo -e "\tMySQL Credentials (root access)......: $MYSQL_CREDENTIALS" fi echo "" +if $PHP_DEBIAN_INSTALLATION ; then + echo -e "\tInstalled PHP version................: $php_major_version" +else + declare -i index=1 + for _ver in $php_major_versions ; do + if [[ $index -eq 1 ]] ; then + echo -en "\tInstalled PHP versions...............: $_ver" + else + echo -en " $_ver" + fi + ((index++)) + done + echo "" + echo -e "\tNewest PHP Version...................: $php_latest_ver" +fi +echo "" echo -e "\tCrontab backup file..................: $crontab_backup_file" echo "" @@ -495,29 +534,6 @@ else fi - -# - Determin PHP of all installed versions -# - -if $PHP_DEBIAN_INSTALLATION ; then - echononl " Get get major version installed PHP" - php_major_version="$(php --version | head -1 | cut -d' ' -f2 | cut -d '-' -f1 | cut -d'.' -f1,2)" - if [[ -z "$php_major_version" ]]; then - echo_failed - error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!" - else - echo_ok - fi -else - echononl " Get major version of all installed PHP versions" - php_major_versions="$(find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort)" - if [[ -z "$php_major_versions" ]]; then - echo_failed - error "Getting version numbers of installed PHP versions failed! No installed PHP versiond found!" - else - echo_ok - fi -fi - # - Stop all PHP FPM engines # - if [[ -n "$php_major_versions" ]]; then