From 8b34367cb4d8d6fca2ff346fe299f8ef0f698f5e Mon Sep 17 00:00:00 2001 From: csznet Date: Fri, 22 Mar 2024 15:23:34 +0800 Subject: [PATCH] get sh --- .gitignore | 3 ++- get.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 767570d..6ba58ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /conf.json /data.db /goForward.db -/main \ No newline at end of file +/main +/goForward \ No newline at end of file diff --git a/get.sh b/get.sh index bcc58d2..b8692be 100644 --- a/get.sh +++ b/get.sh @@ -4,16 +4,16 @@ ARCH=$(uname -m) if [ "$ARCH" == "x86_64" ]; then FILE="goForward.zip" -elif [ "$ARCH" == "aarch64" ]; then +elif [ "$ARCH" == "arm64" ]; then FILE="goForward_arm64.zip" else - echo -e "\e[41mError\e[0m: Unsupported architecture: $ARCH" + echo -e "\033[41mError\033[0m: Unsupported architecture: $ARCH" exit 1 fi # Check if unzip is installed if ! command -v unzip &> /dev/null; then - echo -e "\e[41mError\e[0m: unzip is not installed. Installing..." + echo -e "\033[41mError\033[0m: unzip is not installed. Installing..." # Install unzip based on the package manager if command -v apt-get &> /dev/null; then @@ -21,7 +21,7 @@ if ! command -v unzip &> /dev/null; then elif command -v yum &> /dev/null; then sudo yum install -y unzip else - echo -e "\e[41mError\e[0m: Unsupported package manager. Please install unzip manually." + echo -e "\033[41mError\033[0m: Unsupported package manager. Please install unzip manually." exit 1 fi fi @@ -39,13 +39,13 @@ else fi # Download and unzip -if ! wget $url; then - echo -e "\e[41mError\e[0m: Failed to download $FILE. Please check your internet connection or try again later." +if ! curl -L -O $url; then + echo -e "\033[41mError\033[0m: Failed to download $FILE. Please check your internet connection or try again later." exit 1 fi if ! unzip "$FILE"; then - echo -e "\e[41mError\e[0m: Failed to unzip $FILE." + echo -e "\033[41mError\033[0m: Failed to unzip $FILE." exit 1 fi @@ -55,4 +55,4 @@ rm "$FILE" chmod +x goForward # Output success message -echo -e "\e[44mSuccess\e[0m: The 'goForward' executable is ready for use." \ No newline at end of file +echo -e "\033[44mSuccess\033[0m The 'goForward' executable is ready for use." \ No newline at end of file