From cc146aa5fc064b6b3f3392144e7c7b29a5ada233 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 6 Mar 2023 13:00:33 +0100 Subject: [PATCH] install_postfixadmin.sh: some minor dhanges in script output. --- install_postfixadmin.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/install_postfixadmin.sh b/install_postfixadmin.sh index ca0da11..eb5b83f 100755 --- a/install_postfixadmin.sh +++ b/install_postfixadmin.sh @@ -406,6 +406,25 @@ else fi fi +# - Get activ PHP version, means that on which is part of $PATH environment +# - +echononl "\tGet PHP version in PATH environment.." +if $(which php > /dev/null 2>&1) ; then + php_version_in_path="$(php --version 2> /dev/null | head -1 | cut -d' ' -f2 | cut -d '-' -f1 2> /dev/null)" + if [[ $? -eq 0 ]] && [[ -n "${php_version_in_path}" ]]; then + echo_ok + else + echo_failed + + fatal "Failed getting PHP Version.." + fi +else + echo_skipped + + fatal "No PHP binary found in PATH environment.." +fi + + echo "" echo "" @@ -439,8 +458,18 @@ echo "" if $PHP_DEBIAN_INSTALLATION ; then echo -e "\tInstalled PHP version................: $php_major_version" else - echo -e "\tInstalled PHP versions...............: $php_major_versions" + 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" + echo -e "\tPHP Version of php binary in PATH....: $php_version_in_path" fi echo "" if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then