-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_en.sh
74 lines (54 loc) · 1.64 KB
/
build_en.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
#!/bin/bash
echo -e "\033[31m ************************** \033[0m"
echo -e "\033[31m Hysteria protocol one-click setup script \033[0m"
echo -e "\033[31m *English Mode* \033[0m"
echo " by rei"
echo " Suitable for Debian 8+"
echo -e "\033[31m ************************** \033[0m"
echo -e "\033[31m Confirm to execute the script? Input yes to continue \033[0m"
read confirm
if [ "$confirm" != "yes" ]
then
echo "Execution cancelled"
exit
fi
apt-get update -y
apt-get install curl sudo -y
bash <(curl -fsSL https://get.hy2.sh/)
openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /etc/hysteria/server.key -out /etc/hysteria/server.crt -subj "/CN=bing.com" -days 36500 && sudo chown hysteria /etc/hysteria/server.key && sudo chown hysteria /etc/hysteria/server.crt
echo "Please enter the port you want:"
read port
echo "Customize the password? (1/0):"
read userpwd
password="K33cQAXsTHwevdcToT5XN9+Fzll+"
if [ "$userpwd" = "1" ]
then
echo "Enter custom password:"
read password
fi
echo "Communication port: $port"
echo "Password: $password"
echo "listen: :$port
tls:
cert: /etc/hysteria/server.crt
key: /etc/hysteria/server.key
auth:
type: password
password: $password
masquerade:
type: proxy
proxy:
url: https://bing.com
rewriteHost: true
" > /etc/hysteria/config.yaml
systemctl start hysteria-server.service
clear
echo ""
echo ""
echo ""
echo -e "\033[31m The script has been executed! Now displaying the running status \033[0m"
echo -e "\033[31m Configuration status: \033[0m"
echo "Communication port: $port"
echo "Password: $password"
sleep 1
systemctl status hysteria-server.service