From d41ead065b0b86b52d7d90e626765cff47bb0309 Mon Sep 17 00:00:00 2001 From: xiagw Date: Sat, 19 Sep 2020 15:28:36 +0700 Subject: [PATCH] fix2: fix function install_software (#105) --- install-release.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/install-release.sh b/install-release.sh index 7ac845a..6b04cd6 100644 --- a/install-release.sh +++ b/install-release.sh @@ -214,15 +214,13 @@ judgment_parameters() { install_software() { COMPONENT="$1" - if [[ -n "$(command -v "$COMPONENT")" ]]; then - return - fi - ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT" - if [[ "$?" -ne '0' ]]; then + command -v "$COMPONENT" > /dev/null 2>&1 && return + if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then + echo "info: $COMPONENT is installed." + else echo "error: Installation of $COMPONENT failed, please check your network." exit 1 fi - echo "info: $COMPONENT is installed." } version_number() {