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

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/conf.json /conf.json
/data.db /data.db
/goForward.db /goForward.db
/main /main
/goForward

16
get.sh
View File

@@ -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."