This commit is contained in:
csznet
2024-03-22 15:23:34 +08:00
parent ae721356f4
commit 8b34367cb4
2 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
/data.db
/goForward.db
/main
/goForward

16
get.sh
View File

@@ -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."
echo -e "\033[44mSuccess\033[0m The 'goForward' executable is ready for use."