From 235216037e02d72d7f02c94221fc44b0d9f4c66e Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 9 Feb 2021 01:35:48 +0100 Subject: [PATCH] upgrade_roundcube.sh: add '--no-interaction' to 'composer.phar update --no-dev' command and change error handling. --- upgrade_roundcube.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/upgrade_roundcube.sh b/upgrade_roundcube.sh index 2b8f235..dc888bf 100755 --- a/upgrade_roundcube.sh +++ b/upgrade_roundcube.sh @@ -626,12 +626,21 @@ else fi echononl " Update dependencies by running 'php composer.phar update --no-dev'" -php composer.phar update --no-dev > ${script_dir}/log/update_roundcube-${ROUNDCUBE_VERSION}-dependencies.${backup_date}.log 2>&1 +php composer.phar --no-interaction update --no-dev > ${script_dir}/log/update_roundcube-${ROUNDCUBE_VERSION}-dependencies.${backup_date}.log 2>&1 if [[ $? -eq 0 ]]; then echo_ok else echo_failed - error "$(cat ${script_dir}/log/update_roundcube-${ROUNDCUBE_VERSION}-dependencies.${backup_date}.log)" + error "command was:\n\t # cd "${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}"\n\t #php composer.phar --no-interaction update --no-dev\n\n$(cat ${script_dir}/log/update_roundcube-${ROUNDCUBE_VERSION}-dependencies.${backup_date}.log)" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" fi echononl " Index build-in addressbook" @@ -640,7 +649,16 @@ if [[ $? -eq 0 ]]; then echo_ok else echo_failed - error "$(cat $log_file)" + error "command was:\n\t # ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/bin/indexcontacts.sh\n\n$(cat $log_file)" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" fi _failed=false