From 86d6099516ee37b3634f36d22578393ec492bcd4 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 9 Nov 2017 02:57:43 +0100 Subject: [PATCH] Fix error on upgrade_roundcube.sh: minor changes on script output. --- upgrade_roundcube.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/upgrade_roundcube.sh b/upgrade_roundcube.sh index 1b1cdbe..794bfe2 100755 --- a/upgrade_roundcube.sh +++ b/upgrade_roundcube.sh @@ -356,7 +356,7 @@ fi # - Determin PHP of all installed versions # - -echononl "\tGet major version of all installed PHP versions" +echononl " Get major version of all installed PHP versions" if $PHP_DEBIAN_INSTALLATION ; then php_major_version="$(php --version | head -1 | cut -d' ' -f2 | cut -d '-' -f1 | cut -d'.' -f1,2)" else @@ -371,9 +371,9 @@ fi # - Stop all PHP FPM engines # - -echononl " Stop PHP FPM engine v${_ver}.." if [[ -n "$php_major_versions" ]]; then for _ver in $php_major_versions ; do + echononl " Stop PHP FPM engine v${_ver}.." if [[ -f "/etc/init.d/php-${_ver}-fpm" ]]; then /etc/init.d/php-${_ver}-fpm stop > $log_file 2>&1 if [[ $? -eq 0 ]]; then @@ -396,19 +396,18 @@ if [[ -n "$php_major_versions" ]]; then done else if $PHP_DEBIAN_INSTALLATION ; then - if [[ -f "/etc/init.d/php5-fpm" ]] ; then - /etc/init.d/php5-fpm stop > $log_file 2>&1 - elif [[ -f "/etc/init.d/php7-fpm" ]] ; then - /etc/init.d/php7-fpm stop > $log_file 2>&1 + echononl " Stop PHP FPM engine v${php_major_version}.." + if [[ -f "/etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm" ]] ; then + /etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm stop > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + fi else echo_skipped fi - if [[ $? -eq 0 ]]; then - echo_ok - else - echo_failed - error "$(cat $log_file)" - fi else echo_skipped fi