|
|
|
@ -114,12 +114,13 @@ v2ray_config() { |
|
|
|
|
} |
|
|
|
|
v2ray_port_config() { |
|
|
|
|
if [[ $v2ray_transport_opt -ne 4 && $v2ray_transport_opt -lt 9 ]]; then |
|
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}2333$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port="2333" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port=$random |
|
|
|
|
case $v2ray_port in |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
@ -147,13 +148,13 @@ v2ray_port_config() { |
|
|
|
|
v2ray_dynamic_port_config() { |
|
|
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}2333$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port="2333" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port=$random |
|
|
|
|
case $v2ray_port in |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
@ -182,7 +183,7 @@ v2ray_dynamic_port_start() { |
|
|
|
|
echo " 不能和 V2Ray 端口一毛一样...." |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 动态端口开始 = $cyan$v2ray_dynamic_port_start_input$none" |
|
|
|
@ -210,7 +211,7 @@ v2ray_dynamic_port_end() { |
|
|
|
|
read -p "$(echo -e "(默认结束端口: ${cyan}20000$none):")" v2ray_dynamic_port_end_input |
|
|
|
|
[ -z $v2ray_dynamic_port_end_input ] && v2ray_dynamic_port_end_input=20000 |
|
|
|
|
case $v2ray_dynamic_port_end_input in |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
|
|
|
|
|
if [[ $v2ray_dynamic_port_end_input -le $v2ray_dynamic_port_start_input ]]; then |
|
|
|
|
echo |
|
|
|
@ -241,11 +242,11 @@ v2ray_dynamic_port_end() { |
|
|
|
|
ws_config() { |
|
|
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}2333$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port="2333" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port |
|
|
|
|
[ -z "$v2ray_port" ] && v2ray_port=$random |
|
|
|
|
case $v2ray_port in |
|
|
|
|
80) |
|
|
|
|
echo |
|
|
|
@ -257,7 +258,7 @@ ws_config() { |
|
|
|
|
echo " ..都说了不能选择 433 端口了咯....." |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
@ -492,17 +493,18 @@ shadowsocks_config() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
shadowsocks_port_config() { |
|
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入 "$yellow"Shadowsocks"$none" 端口 ["$magenta"1-65535"$none"],不能和 "$yellow"V2Ray"$none" 端口相同" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}6666$none):") " ssport |
|
|
|
|
[ -z "$ssport" ] && ssport="6666" |
|
|
|
|
read -p "$(echo -e "(默认端口: ${cyan}${random}$none):") " ssport |
|
|
|
|
[ -z "$ssport" ] && ssport=$random |
|
|
|
|
case $ssport in |
|
|
|
|
$v2ray_port) |
|
|
|
|
echo |
|
|
|
|
echo " 不能和 V2Ray 端口一毛一样...." |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | [1-6][0-5][0-5][0-3][0-5]) |
|
|
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
if [[ $v2ray_transport_opt == "4" && $ssport == "80" ]] || [[ $v2ray_transport_opt == "4" && $ssport == "443" ]]; then |
|
|
|
|
echo |
|
|
|
|
echo -e "由于你选择了 "$green"WebSocket + TLS"$none" 传输协议." |
|
|
|
@ -825,7 +827,6 @@ install_v2ray() { |
|
|
|
|
|
|
|
|
|
rm -rf /tmp/v2ray |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ $shadowsocks ]; then |
|
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
|
case $v2ray_transport_opt in |
|
|
|
@ -1021,8 +1022,8 @@ open_port() { |
|
|
|
|
iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
else |
|
|
|
|
service iptables save |
|
|
|
|
service ip6tables save |
|
|
|
|
service iptables save >/dev/null 2>&1 |
|
|
|
|
service ip6tables save >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
del_port() { |
|
|
|
@ -1058,8 +1059,8 @@ del_port() { |
|
|
|
|
iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
else |
|
|
|
|
service iptables save |
|
|
|
|
service ip6tables save |
|
|
|
|
service iptables save >/dev/null 2>&1 |
|
|
|
|
service ip6tables save >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|