forked from bepass-org/warp-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtermux.sh.broken
128 lines (109 loc) · 4.32 KB
/
termux.sh.broken
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
# Define colors for use in console output
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
purple='\033[0;35m'
cyan='\033[0;36m'
rest='\033[0m'
# Function to check and install dependencies required for building Warp
check_dependencies_build() {
local dependencies=("curl" "wget" "git" "golang")
for dep in "${dependencies[@]}"; do
# Check if the dependency is installed, if not install it
if ! dpkg -s "${dep}" &> /dev/null; then
echo -e "${yellow}${dep} is not installed. Installing...${rest}"
pkg install "${dep}" -y
fi
done
}
# Function to check and install dependencies required for installing Warp
check_dependencies() {
local dependencies=("curl" "openssl-tool" "wget" "unzip")
for dep in "${dependencies[@]}"; do
# Check if the dependency is installed, if not install it
if ! dpkg -s "${dep}" &> /dev/null; then
echo -e "${yellow}${dep} is not installed. Installing...${rest}"
pkg install "${dep}" -y
fi
done
}
# Function to build and install Warp
build() {
# Check if Warp is already installed
if command -v warp &> /dev/null || command -v usef &> /dev/null; then
echo -e "${green}Warp is already installed.${rest}"
return
fi
echo -e "${green}Installing Warp...${rest}"
pkg update -y && pkg upgrade -y
# Check and install dependencies required for building Warp
check_dependencies_build
# Clone the Warp repository, build the main.go file, and copy the binary to /data/data/com.termux/files/usr/bin
if git clone https://github.com/bepass-org/wireguard-go.git &&
cd wireguard-go &&
go build main.go &&
chmod +x main &&
cp main "$PREFIX/bin/usef" &&
cp main "$PREFIX/bin/warp"; then
echo -e "${green}Warp installed successfully.${rest}"
else
echo -e "${red}Error installing WireGuard VPN.${rest}"
fi
}
# Function to install Warp
install() {
# Check if Warp is already installed
if command -v warp &> /dev/null || command -v usef &> /dev/null; then
echo -e "${green}Warp is already installed.${rest}"
return
fi
echo -e "${green}Installing Warp...${rest}"
pkg update -y && pkg upgrade -y
# Check and install dependencies required for installing Warp
check_dependencies
# Download the Warp binary, extract it, and copy the binary to /data/data/com.termux/files/usr/bin
if wget https://github.com/bepass-org/wireguard-go/releases/download/v1.0.1-rc1/warp-android-arm64.9f90b7.zip &&
unzip warp-android-arm64.9f90b7.zip &&
chmod +x warp &&
cp warp "$PREFIX/bin/usef" &&
cp warp "$PREFIX/bin/warp"; then
rm "README.md" "LICENSE" "warp-linux-arm64.9f90b7.zip"
echo "================================================"
echo -e "${green}Warp installed successfully.${rest}"
socks
else
echo -e "${red}Error installing Warp.${rest}"
fi
}
# Function to install Warp for ARM architecture
install_arm() {
# Check if Warp is already installed
if command -v warp &> /dev/null || command -v usef &> /dev/null; then
echo -e "${green}Warp is already installed.${rest}"
return
fi
echo -e "${green}Installing Warp...${rest}"
pkg update -y && pkg upgrade -y
# Check and install dependencies required for installing Warp
check_dependencies
# Determine the architecture and download the appropriate Warp binary
case "$(dpkg --print-architecture)" in
i386) ARCH="386" ;;
amd64) ARCH="amd64" ;;
armhf) ARCH="arm5" ;;
arm) ARCH="arm7" ;;
aarch64) ARCH="arm64" ;;
*) echo -e "${red}Unsupported architecture.${rest}"; return ;;
esac
WARP_URL="https://github.com/bepass-org/wireguard-go/releases/download/v1.0.1-rc1/warp-linux-$ARCH.9f90b7.zip"
# Download the Warp binary, extract it, and copy the binary to /data/data/com.termux/files/usr/bin
if wget "$WARP_URL" &&
unzip "warp-linux-$ARCH.9f90b7.zip" &&
chmod +x warp &&
cp warp "$PREFIX/bin/usef" &&
cp warp "$PREFIX/bin/warp"; then
rm "README.md" "LICENSE" "warp-linux-$ARCH.9f90b7.zip"
echo "================================================"
echo -e "${green}Warp installed successfully.${rest}"