mirror of
https://github.com/csznet/goForward.git
synced 2025-09-27 03:35:54 +08:00
get sh
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
/data.db
|
/data.db
|
||||||
/goForward.db
|
/goForward.db
|
||||||
/main
|
/main
|
||||||
|
/goForward
|
16
get.sh
16
get.sh
@@ -4,16 +4,16 @@ ARCH=$(uname -m)
|
|||||||
|
|
||||||
if [ "$ARCH" == "x86_64" ]; then
|
if [ "$ARCH" == "x86_64" ]; then
|
||||||
FILE="goForward.zip"
|
FILE="goForward.zip"
|
||||||
elif [ "$ARCH" == "aarch64" ]; then
|
elif [ "$ARCH" == "arm64" ]; then
|
||||||
FILE="goForward_arm64.zip"
|
FILE="goForward_arm64.zip"
|
||||||
else
|
else
|
||||||
echo -e "\e[41mError\e[0m: Unsupported architecture: $ARCH"
|
echo -e "\033[41mError\033[0m: Unsupported architecture: $ARCH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if unzip is installed
|
# Check if unzip is installed
|
||||||
if ! command -v unzip &> /dev/null; then
|
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
|
# Install unzip based on the package manager
|
||||||
if command -v apt-get &> /dev/null; then
|
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
|
elif command -v yum &> /dev/null; then
|
||||||
sudo yum install -y unzip
|
sudo yum install -y unzip
|
||||||
else
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -39,13 +39,13 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Download and unzip
|
# Download and unzip
|
||||||
if ! wget $url; then
|
if ! curl -L -O $url; then
|
||||||
echo -e "\e[41mError\e[0m: Failed to download $FILE. Please check your internet connection or try again later."
|
echo -e "\033[41mError\033[0m: Failed to download $FILE. Please check your internet connection or try again later."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! unzip "$FILE"; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -55,4 +55,4 @@ rm "$FILE"
|
|||||||
chmod +x goForward
|
chmod +x goForward
|
||||||
|
|
||||||
# Output success message
|
# 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