forked from radkesvat/ReverseTlsTunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
71 lines (48 loc) · 1.7 KB
/
install.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
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
if [ "$EUID" -ne 0 ]
then echo "Please run as root."
exit
fi
#echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
if pgrep -x "RTT" > /dev/null; then
echo "Tunnel is running!. you must stop the tunnel before update. (pkill RTT)"
echo "update is canceled."
exit
fi
apt-get update -y
REQUIRED_PKG="unzip"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
REQUIRED_PKG="wget"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
REQUIRED_PKG="lsof"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
printf "\n"
printf "\n"
echo "downloading ReverseTlsTunnel"
printf "\n"
case $(uname -m) in
x86_64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V5.0/v5.0_linux_amd64.zip" ;;
arm) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V5.0/v5.0_linux_arm64.zip" ;;
aarch64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V5.0/v5.0_linux_arm64.zip" ;;
*) echo "Unable to determine system architecture."; exit 1 ;;
esac
wget $URL -O v5.0_linux_amd64.zip
unzip -o v5.0_linux_amd64.zip
chmod +x RTT
rm v5.0_linux_amd64.zip
echo "finished."
printf "\n"