-
Notifications
You must be signed in to change notification settings - Fork 40
/
install3.sh
37 lines (31 loc) · 1.02 KB
/
install3.sh
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
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Run script as root, sudo -i."
exit 1
fi
sudo apt update -y
architecture=$(uname -m)
if [ "$architecture" = "x86_64" ]; then
if [ ! -f "go1.21.5.linux-amd64.tar.gz" ]; then
wget https://github.com/Azumi67/UDP2RAW_FEC/releases/download/go/go1.21.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
fi
elif [ "$architecture" = "aarch64" ]; then
if [ ! -f "go1.21.5.linux-arm64.tar.gz" ]; then
wget https://github.com/Azumi67/UDP2RAW_FEC/releases/download/go/go1.21.5.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.21.5.linux-arm64.tar.gz
fi
else
echo "Unsupported arch: $architecture"
exit 1
fi
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bash_profile
source ~/.bash_profile
go mod init mymodule
go mod tidy
if [ -f "install3.go" ]; then
rm install3.go
echo "deleted previous version!"
fi
wget https://raw.githubusercontent.com/Azumi67/Rathole_reverseTunnel/main/install3.go
go run install3.go