mirror of
https://github.com/csznet/goForward.git
synced 2025-09-26 19:31:11 +08:00
get sh
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/data.db
|
||||
/goForward.db
|
||||
/main
|
||||
/goForward
|
16
get.sh
16
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."
|
||||
echo -e "\033[44mSuccess\033[0m The 'goForward' executable is ready for use."
|
Reference in New Issue
Block a user