Skip to content

Commit

Permalink
clean log
Browse files Browse the repository at this point in the history
  • Loading branch information
sunway910 committed Aug 29, 2024
1 parent 6d5359e commit 764af47
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ install_dependencies() {
if [ x"$DISTRO" == x"Ubuntu" ]; then
log_info "------------Apt update--------------"
if ! apt-get update; then
log_info "Please check your network or apt source and then try again"
log_err "Apt update failed"
exit 1
fi

log_info "------------Install dependencies--------------"
if ! apt-get install -y git jq curl wget net-tools; then
log_err "Failed to install some libs "
log_info "You can install it manually and ignore this error log"
log_info "Can install it manually and ignore this error log"
fi
if ! command_exists nc; then
apt-get install -y netcat
Expand All @@ -55,14 +56,15 @@ install_dependencies() {
elif [ x"$DISTRO" == x"CentOS" ]; then
log_info "------------Yum update--------------"
if ! yum update; then
log_info "Please check your network or yum source and then try again"
log_err "Yum update failed"
exit 1
fi
log_info "------------Install dependencies--------------"

if ! yum install -y git jq curl wget net-tools; then
log_err "Failed to install some libs "
log_info "You can install it manually and ignore this error log"
log_err "Failed to install some libs"
log_info "Can install it manually and ignore this error log"
fi
if ! command_exists nc; then
sudo yum install epel-release -y
Expand Down Expand Up @@ -94,7 +96,7 @@ install_dependencies() {
done
if ! command_exists yq; then
log_err "Install yq failed"
exit 1
log_info "Can install it manually and ignore this error log"
fi

need_install_docker=1
Expand All @@ -112,7 +114,7 @@ install_dependencies() {
# install or update docker
if ! curl -fsSL https://get.docker.com | bash; then
log_err "Install docker failed"
log_info "You can install docker manually and ignore this error log"
log_info "Can install docker manually and ignore this error log"
fi
fi

Expand All @@ -122,15 +124,15 @@ install_dependencies() {
add_docker_ubuntu_repo
if ! apt-get install -y docker-compose-plugin; then
log_err "Install docker-compose-plugin failed"
log_info "You can install docker compose manually and ignore this error log"
log_info "Can install docker compose manually and ignore this error log"
fi
fi
elif [ x"$DISTRO" == x"CentOS" ]; then
if ! rpm -qa | grep -q docker-compose-plugin; then
add_docker_centos_repo
if ! yum install -y docker-compose-plugin; then
log_err "Install docker-compose-plugin failed"
log_info "You can install docker compose manually and ignore this error log"
log_info "Can install docker compose manually and ignore this error log"
fi
fi
fi
Expand Down

0 comments on commit 764af47

Please sign in to comment.