From a6ad519b9b52ea88c543d68c27e4ef2f95287ed3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 9 Nov 2017 04:55:08 +0100 Subject: [PATCH] Somer minor changes on output of scripts 'install_roundcube.sh' and 'upgrade_roundcube.sh'. --- install_roundcube.sh | 9 ++++++++- upgrade_roundcube.sh | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/install_roundcube.sh b/install_roundcube.sh index 9bd5382..1b8102e 100755 --- a/install_roundcube.sh +++ b/install_roundcube.sh @@ -293,10 +293,17 @@ fi # - Determin PHP of all installed versions # - -echononl "\tGet major version of all installed PHP versions" if $PHP_DEBIAN_INSTALLATION ; then + echononl "\tGet major version of 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 major version of installed PHP versions failed! No installed PHP versiond found!" + else + echo_ok + fi else + echononl "\tGet 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 diff --git a/upgrade_roundcube.sh b/upgrade_roundcube.sh index fa4e149..064aff0 100755 --- a/upgrade_roundcube.sh +++ b/upgrade_roundcube.sh @@ -357,8 +357,14 @@ fi # - Determin PHP of all installed versions # - if $PHP_DEBIAN_INSTALLATION ; then - echononl " Get installed PHP versions" + 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)"