forked from q158073378252010/v2ray.fun
-
Notifications
You must be signed in to change notification settings - Fork 25
/
v2ray
executable file
·158 lines (145 loc) · 4.25 KB
/
v2ray
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#Check Root
[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script"; exit 1; }
echo "欢迎使用 V2ray.fun 管理程序 Author:雨落无声"
echo ""
echo "1.服务管理"
echo "2.更改配置"
echo "3.查看服务端信息"
echo "4.下载客户端配置文件"
echo "请输入数字选择功能(按回车键退出):"
while :; do echo
read -p "请选择: " choice
if [[ ! $choice =~ ^[1-4]$ ]]; then
if [[ -z ${choice} ]];then
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
break
fi
done
if [[ ${choice} == 1 ]]; then
echo "1.启动服务"
echo "2.停止服务"
echo "3.重启服务"
echo "4.运行状态"
echo "5.运行日志"
while :; do echo
read -p "请选择: " schoice
if [[ ! $schoice =~ ^[1-5]$ ]]; then
if [[ -z ${schoice} ]];then
bash /usr/local/bin/v2ray
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
break
fi
done
if [[ ${schoice} == 1 ]]; then
service v2ray start
python /usr/local/v2ray.fun/openport.py
python /usr/local/v2ray.fun/genclient.py
echo "服务启动成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${schoice} == 2 ]]; then
service v2ray stop
echo "服务停止成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${schoice} == 3 ]]; then
service v2ray restart
python /usr/local/v2ray.fun/openport.py
python /usr/local/v2ray.fun/genclient.py
echo "服务已重启!"
bash /usr/local/bin/v2ray
fi
if [[ ${schoice} == 4 ]]; then
service v2ray status
bash /usr/local/bin/v2ray
fi
if [[ ${schoice} == 5 ]]; then
echo "按Ctrl + C 可以退出日志功能"
echo ""
tail -f /var/log/v2ray/access.log
bash /usr/local/bin/v2ray
fi
fi
if [[ ${choice} == 2 ]]; then
echo ""
echo "1.更改UUID"
echo "2.更改主端口"
echo "3.更改加密方式"
echo "4.更改传输方式"
echo "5.更改TLS设置"
echo ""
echo "请输入数字选择功能:"
while :; do echo
read -p "请选择: " changechoice
if [[ ! $changechoice =~ ^[1-5]$ ]]; then
if [[ -z ${changechoice} ]];then
bash /usr/local/bin/v2ray
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
break
fi
done
if [[ ${changechoice} == 1 ]]; then
python /usr/local/v2ray.fun/changeuuid.py
python /usr/local/v2ray.fun/genclient.py
service v2ray restart
echo ""
echo "UUID修改成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${changechoice} == 2 ]]; then
python /usr/local/v2ray.fun/changeport.py
python /usr/local/v2ray.fun/genclient.py
python /usr/local/v2ray.fun/openport.py
service v2ray restart
echo ""
echo "端口修改成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${changechoice} == 3 ]]; then
python /usr/local/v2ray.fun/changesecurity.py
python /usr/local/v2ray.fun/genclient.py
service v2ray restart
echo ""
echo "加密方式修改成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${changechoice} == 4 ]]; then
python /usr/local/v2ray.fun/changestream.py
python /usr/local/v2ray.fun/genclient.py
service v2ray restart
echo ""
echo "传输模式修改成功!"
bash /usr/local/bin/v2ray
fi
if [[ ${changechoice} == 5 ]]; then
python /usr/local/v2ray.fun/changetls.py
python /usr/local/v2ray.fun/genclient.py
service v2ray restart
echo ""
echo "TLS设置修改成功!"
bash /usr/local/bin/v2ray
fi
fi
if [[ ${choice} == 3 ]]; then
python /usr/local/v2ray.fun/serverinfo.py
bash /usr/local/bin/v2ray
fi
if [[ ${choice} == 4 ]]; then
echo "请选择文件保存位置(此功能仅限Xshell使用)"
python /usr/local/v2ray.fun/genclient.py
sz /root/config.json
echo "保存成功!"
echo ""
bash /usr/local/bin/v2ray
fi