-
Notifications
You must be signed in to change notification settings - Fork 39
/
install.sh
executable file
·80 lines (73 loc) · 2.25 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
72
73
74
75
76
77
78
79
80
#!/bin/bash
Install_Hiper(){
wget -q https://gitcode.net/to/hiper/-/raw/master/linux-amd64/hiper -O /usr/local/bin/hiper
chmod +x /usr/local/bin/hiper
sudo hiper -service install -config $HIPER_AUTH_TOKEN
sudo hiper -service start
echo Setting Up Hiper
}
Install_CFT(){
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb &&
sudo dpkg -i cloudflared.deb &&
sudo cloudflared service install $CFT_AUTH_TOKEN
}
Install_Ngrok(){
wget -q https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
tar -xzf ngrok-v3-stable-linux-amd64.tgz
chmod +x ./ngrok
./ngrok config add-authtoken $NGROK_AUTH_TOKEN
./ngrok http 8080
echo Setting Up Ngrok
}
Install_Frp_SAKURA(){
wget -q https://nya.globalslb.net/natfrp/client/frpc/0.45.0-sakura-7/frpc_linux_amd64
mv ./frpc_linux_amd64 ./frpc && chmod +x ./frpc
sudo ./frpc -f $FRP_AUTH_TOKEN
echo Setting Up Frp SAKURA
}
Install_Frp_OTHER(){
FRP_FILE_URL=$(curl -s https://api.github.com/repos/fatedier/frp/releases/latest | grep linux_amd64 | grep browser_download_url | cut -d '"' -f 4)
wget -q ${FRP_FILE_URL} -O frp.tar.gz
tar -xzf frp.tar.gz
mv ./frp_0.51.3_linux_amd64/frpc ./frpc && chmod +x ./frpc
cat >./frpc.ini<<EOF
[common]
server_addr = $FRP_ADDRESS
server_port = $FRP_PORT
user = $FRP_USER
token = $FRP_AUTH_TOKEN
[test_htts2http]
type = https
custom_domains = $FRP_DOMAIN
plugin = https2http
plugin_local_addr = 127.0.0.1:8080
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp
EOF
sudo ./frpc -c ./frpc.ini
echo Setting Up Frp Other
}
Install_NPS(){
wget -q https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_client.tar.gz
tar -xzf linux_amd64_client.tar.gz
chmod +x ./npc
sudo ./npc install -server="$NPS_ADDRESS" -vkey="$NPS_AUTH_TOKEN" -type="$NPS_TYPE"
sudo rm -rf linux_amd64_client.tar.gz conf
sudo npc start
echo Setting Up NPS
}
if [ "$TYPE" == "HIPER" ]; then
Install_Hiper
elif [ "$TYPE" == "CFT" ]; then
Install_CFT
elif [ "$TYPE" == "NGROK" ]; then
Install_Ngrok
elif [ "$TYPE" == "NPS" ]; then
Install_NPS
elif [ "$TYPE" == "FRP" ]; then
if [ "$FRP_TYPE" == "SAKURA" ]; then
Install_Frp_SAKURA
else
Install_Frp_OTHER
fi
fi