-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy pathssr
164 lines (147 loc) · 4.33 KB
/
ssr
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
159
160
161
162
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# 检测是否以 root 用户运行
[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script"; exit 1; }
echo ""
echo "欢迎使用 ssr.go 管理程序"
echo ""
echo "1.服务管理"
echo "2.更改配置"
echo "3.查看服务端信息"
echo "4.更新ssr和ssr.go"
echo "请输入数字选择功能(按回车键退出):"
while :; do echo
read -n1 -p "请选择: " choice
if [[ ! $choice =~ ^[1-4]$ ]]; then
if [[ -z ${choice} ]];then
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
echo -e "\n"
break
fi
done
# 更新ssr和ssr.go的操作
if [[ ${choice} == 4 ]]; then
wget https://raw.githubusercontent.com/leitbogioro/ShadowsocksRR-Install/Dev/shadowsocksRR.sh
chmod +x shadowsocksRR.sh
./shadowsocksRR.sh 2>&1 | tee shadowsocksR.log
fi
if [[ ${choice} == 1 ]]; then
echo "1.启动服务"
echo "2.停止服务"
echo "3.重启服务"
echo "4.运行状态"
echo "5.运行日志"
while :; do echo
read -n1 -p "请选择: " schoice
if [[ ! $schoice =~ ^[1-5]$ ]]; then
if [[ -z ${schoice} ]];then
bash /usr/local/bin/ssr
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
echo -e "\n"
break
fi
done
# 启动ssr
if [[ ${schoice} == 1 ]]; then
/etc/init.d/shadowsocks start
# 这里需要添加生成二维码模块
echo "ssrr服务启动成功!"
bash /usr/local/bin/ssr
fi
if [[ ${schoice} == 2 ]]; then
/etc/init.d/shadowsocks stop
echo "ssrr服务停止成功!"
bash /usr/local/bin/ssr
fi
if [[ ${schoice} == 3 ]]; then
/etc/init.d/shadowsocks restart
# 这里需要添加生成二维码模块
echo "ssrr服务已重启!"
bash /usr/local/bin/ssr
fi
if [[ ${schoice} == 4 ]]; then
/etc/init.d/shadowsocks status
bash /usr/local/bin/ssr
fi
if [[ ${schoice} == 5 ]]; then
echo "按Ctrl + C 以退出日志功能"
echo ""
tail -f /var/log/shadowsocksr.log
bash /usr/local/bin/ssr
fi
fi
# 更改配置模块
if [[ ${choice} == 2 ]]; then
echo ""
echo "1.更改密码"
echo "2.更改端口"
echo "3.更改加密方式"
echo "4.更改协议"
echo "5.更改混淆模式"
echo "请输入数字选择功能:"
while :; do echo
read -n1 -p "请选择: " changechoice
if [[ ! $changechoice =~ ^[1-5]$ ]]; then
if [[ -z ${changechoice} ]];then
bash /usr/local/bin/ssr
exit 0
fi
echo "输入错误! 请输入正确的数字!"
else
echo -e "\n"
break
fi
done
if [[ ${changechoice} == 1 ]]; then
python /usr/local/SSR.Go/changepwd.py
# 这里需要添加生成二维码模块
/etc/init.d/shadowsocks restart
echo ""
echo "密码配置已完成!"
bash /usr/local/bin/ssr
fi
if [[ ${changechoice} == 2 ]]; then
python /usr/local/SSR.Go/changeport.py
# 这里需要添加生成二维码模块
# 这里需要建立 openport 模块
/etc/init.d/shadowsocks restart
echo ""
echo "端口配置已完成!"
bash /usr/local/bin/ssr
fi
if [[ ${changechoice} == 3 ]]; then
python /usr/local/SSR.Go/changemethod.py
# 这里需要添加生成二维码模块
/etc/init.d/shadowsocks restart
echo ""
echo "加密方式配置已完成!"
bash /usr/local/bin/ssr
fi
if [[ ${changechoice} == 4 ]]; then
python /usr/local/SSR.Go/changeprotocol.py
# 这里需要添加生成二维码模块
/etc/init.d/shadowsocks restart
echo ""
echo "传输协议配置已完成!"
bash /usr/local/bin/ssr
fi
if [[ ${changechoice} == 5 ]]; then
python /usr/local/SSR.Go/changeobfs.py
# 这里需要添加生成二维码模块
/etc/init.d/shadowsocks restart
echo ""
echo "混淆模式配置已完成!"
bash /usr/local/bin/ssr
fi
fi
# 查看服务信息模块
if [[ ${choice} == 3 ]]; then
python /usr/local/SSR.Go/connectinfo.py
bash /usr/local/bin/ssr
fi