|
|
|
@ -10,7 +10,7 @@ none='\e[0m' |
|
|
|
|
# Root |
|
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
|
|
|
|
|
|
_version="v3.37" |
|
|
|
|
_version="v3.52" |
|
|
|
|
|
|
|
|
|
cmd="apt-get" |
|
|
|
|
|
|
|
|
@ -69,7 +69,7 @@ fi |
|
|
|
|
if [[ $mark != "v3" ]]; then |
|
|
|
|
. /etc/v2ray/233boy/v2ray/tools/v3.sh |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then |
|
|
|
|
dynamicPort=true |
|
|
|
|
port_range="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}" |
|
|
|
|
fi |
|
|
|
@ -89,6 +89,13 @@ v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" |
|
|
|
|
systemd=true |
|
|
|
|
# _test=true |
|
|
|
|
|
|
|
|
|
# fix VMessAEAD |
|
|
|
|
if [[ ! $(grep 'v2ray.vmess.aead.forced=false' /lib/systemd/system/v2ray.service) ]]; then |
|
|
|
|
sed -i 's|ExecStart=|ExecStart=/usr/bin/env v2ray.vmess.aead.forced=false |' /lib/systemd/system/v2ray.service |
|
|
|
|
systemctl daemon-reload |
|
|
|
|
systemctl restart v2ray |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [[ $v2ray_ver != v* ]]; then |
|
|
|
|
v2ray_ver="v$v2ray_ver" |
|
|
|
|
fi |
|
|
|
@ -103,7 +110,7 @@ if [ $v2ray_pid ]; then |
|
|
|
|
else |
|
|
|
|
v2ray_status="$red未在运行$none" |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport == [45] && $caddy ]] && [[ $caddy_pid ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy_pid && $caddy ]]; then |
|
|
|
|
caddy_run_status="$green正在运行$none" |
|
|
|
|
else |
|
|
|
|
caddy_run_status="$red未在运行$none" |
|
|
|
@ -111,10 +118,6 @@ fi |
|
|
|
|
|
|
|
|
|
_load transport.sh |
|
|
|
|
ciphers=( |
|
|
|
|
aes-128-cfb |
|
|
|
|
aes-256-cfb |
|
|
|
|
chacha20 |
|
|
|
|
chacha20-ietf |
|
|
|
|
aes-128-gcm |
|
|
|
|
aes-256-gcm |
|
|
|
|
chacha20-ietf-poly1305 |
|
|
|
@ -144,6 +147,10 @@ create_vmess_URL_config() { |
|
|
|
|
"tls": "tls" |
|
|
|
|
} |
|
|
|
|
EOF |
|
|
|
|
elif [[ $v2ray_transport == 33 ]]; then |
|
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
|
vless://${v2ray_id}@${domain}:443?encryption=none&security=tls&type=ws&host=${domain}&path=${_path}#233v2_${domain} |
|
|
|
|
EOF |
|
|
|
|
else |
|
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
@ -301,7 +308,6 @@ shadowsocks_config() { |
|
|
|
|
shadowsocks_password_config |
|
|
|
|
shadowsocks_ciphers_config |
|
|
|
|
pause |
|
|
|
|
open_port $new_ssport |
|
|
|
|
backup_config +ss |
|
|
|
|
ssport=$new_ssport |
|
|
|
|
sspass=$new_sspass |
|
|
|
@ -337,7 +343,7 @@ shadowsocks_port_config() { |
|
|
|
|
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] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]]; then |
|
|
|
|
local tls=ture |
|
|
|
|
fi |
|
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
|
@ -410,17 +416,17 @@ shadowsocks_password_config() { |
|
|
|
|
shadowsocks_ciphers_config() { |
|
|
|
|
|
|
|
|
|
while :; do |
|
|
|
|
echo -e "请选择 "$yellow"Shadowsocks"$none" 加密协议 [${magenta}1-7$none]" |
|
|
|
|
echo -e "请选择 "$yellow"Shadowsocks"$none" 加密协议 [${magenta}1-3$none]" |
|
|
|
|
for ((i = 1; i <= ${#ciphers[*]}; i++)); do |
|
|
|
|
ciphers_show="${ciphers[$i - 1]}" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow $i. $none${ciphers_show}" |
|
|
|
|
done |
|
|
|
|
echo |
|
|
|
|
read -p "$(echo -e "(默认加密协议: ${cyan}${ciphers[6]}$none)"):" ssciphers_opt |
|
|
|
|
[ -z "$ssciphers_opt" ] && ssciphers_opt=7 |
|
|
|
|
read -p "$(echo -e "(默认加密协议: ${cyan}${ciphers[1]}$none)"):" ssciphers_opt |
|
|
|
|
[ -z "$ssciphers_opt" ] && ssciphers_opt=2 |
|
|
|
|
case $ssciphers_opt in |
|
|
|
|
[1-7]) |
|
|
|
|
[1-3]) |
|
|
|
|
new_ssciphers=${ciphers[$ssciphers_opt - 1]} |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
@ -455,7 +461,7 @@ change_shadowsocks_port() { |
|
|
|
|
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] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5]) |
|
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]]; then |
|
|
|
|
local tls=ture |
|
|
|
|
fi |
|
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
|
@ -488,8 +494,6 @@ change_shadowsocks_port() { |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
backup_config ssport |
|
|
|
|
del_port $ssport |
|
|
|
|
open_port $new_ssport |
|
|
|
|
ssport=$new_ssport |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
@ -557,7 +561,7 @@ change_shadowsocks_ciphers() { |
|
|
|
|
read -p "$(echo -e "(当前加密协议: ${cyan}${ssciphers}$none)"):" ssciphers_opt |
|
|
|
|
[ -z "$ssciphers_opt" ] && error && continue |
|
|
|
|
case $ssciphers_opt in |
|
|
|
|
[1-7]) |
|
|
|
|
[1-3]) |
|
|
|
|
new_ssciphers=${ciphers[$ssciphers_opt - 1]} |
|
|
|
|
if [[ $new_ssciphers == $ssciphers ]]; then |
|
|
|
|
echo |
|
|
|
@ -601,7 +605,6 @@ disable_shadowsocks() { |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
backup_config -ss |
|
|
|
|
del_port $ssport |
|
|
|
|
shadowsocks='' |
|
|
|
|
config |
|
|
|
|
# clear |
|
|
|
@ -757,8 +760,6 @@ change_v2ray_port() { |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
backup_config v2ray_port |
|
|
|
|
del_port $v2ray_port |
|
|
|
|
open_port $v2ray_port_opt |
|
|
|
|
v2ray_port=$v2ray_port_opt |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
@ -838,7 +839,7 @@ change_v2ray_transport() { |
|
|
|
|
echo " 哎呀...跟当前传输协议一毛一样呀...修改个鸡鸡哦" |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
4 | 5) |
|
|
|
|
4 | 5 | 33) |
|
|
|
|
if [[ $v2ray_port == "80" || $v2ray_port == "443" ]]; then |
|
|
|
|
echo |
|
|
|
|
echo -e " 抱歉...如果你想要使用${cyan} ${transport[$v2ray_transport_opt - 1]} $none传输协议.. ${red}V2Ray 端口不能为 80 或者 443 ...$none" |
|
|
|
@ -872,7 +873,7 @@ change_v2ray_transport() { |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
;; |
|
|
|
|
[1-9] | [1-2][0-9] | 3[0-2]) |
|
|
|
|
[1-9] | [1-2][0-9] | 3[0-3]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
|
@ -889,14 +890,13 @@ change_v2ray_transport() { |
|
|
|
|
done |
|
|
|
|
pause |
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == [45] ]]; then |
|
|
|
|
if [[ $v2ray_transport_opt == [45] || $v2ray_transport_opt == 33 ]]; then |
|
|
|
|
tls_config |
|
|
|
|
elif [[ $v2ray_transport_opt -ge 18 ]]; then |
|
|
|
|
elif [[ $v2ray_transport_opt -ge 18 && $v2ray_transport_opt -ne 33 ]]; then |
|
|
|
|
v2ray_dynamic_port_start |
|
|
|
|
v2ray_dynamic_port_end |
|
|
|
|
pause |
|
|
|
|
old_transport |
|
|
|
|
open_port "multiport" |
|
|
|
|
backup_config v2ray_transport v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
@ -916,9 +916,7 @@ change_v2ray_transport() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
old_transport() { |
|
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
|
del_port "80" |
|
|
|
|
del_port "443" |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]]; then |
|
|
|
|
if [[ $caddy && $caddy_pid ]]; then |
|
|
|
|
do_service stop caddy |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
@ -936,8 +934,6 @@ old_transport() { |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
|
backup_config -path |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -946,7 +942,7 @@ tls_config() { |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "请输入一个 $magenta正确的域名$none,一定一定一定要正确,不!能!出!错!" |
|
|
|
|
echo -e "请输入一个 ${magenta}正确的域名${none},一定一定一定要正确,不!能!出!错!" |
|
|
|
|
read -p "(例如:233blog.com): " new_domain |
|
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
|
echo |
|
|
|
@ -999,13 +995,8 @@ tls_config() { |
|
|
|
|
is_path=true |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
domain=$new_domain |
|
|
|
|
|
|
|
|
|
open_port "80" |
|
|
|
|
open_port "443" |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl enable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
@ -1018,7 +1009,7 @@ tls_config() { |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
# download_v2ray_config_ask |
|
|
|
|
else |
|
|
|
|
if [[ $v2ray_transport_opt == 5 ]]; then |
|
|
|
|
if [[ $v2ray_transport_opt -ne 4 ]]; then |
|
|
|
|
path_config_ask |
|
|
|
|
pause |
|
|
|
|
domain_check |
|
|
|
@ -1029,13 +1020,8 @@ tls_config() { |
|
|
|
|
proxy_site=$new_proxy_site |
|
|
|
|
is_path=true |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
domain=$new_domain |
|
|
|
|
install_caddy |
|
|
|
|
open_port "80" |
|
|
|
|
open_port "443" |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
|
caddy_config |
|
|
|
|
config |
|
|
|
@ -1085,13 +1071,8 @@ auto_tls_config() { |
|
|
|
|
proxy_site=$new_proxy_site |
|
|
|
|
is_path=true |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
domain=$new_domain |
|
|
|
|
install_caddy |
|
|
|
|
open_port "80" |
|
|
|
|
open_port "443" |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
|
caddy_config |
|
|
|
|
config |
|
|
|
@ -1109,12 +1090,7 @@ auto_tls_config() { |
|
|
|
|
pause |
|
|
|
|
domain_check |
|
|
|
|
backup_config v2ray_transport domain |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
domain=$new_domain |
|
|
|
|
open_port "80" |
|
|
|
|
open_port "443" |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
@ -1340,12 +1316,10 @@ v2ray_dynamic_port_end() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
change_v2ray_dynamicport() { |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then |
|
|
|
|
change_v2ray_dynamic_port_start |
|
|
|
|
change_v2ray_dynamic_port_end |
|
|
|
|
pause |
|
|
|
|
del_port "multiport" |
|
|
|
|
open_port "multiport" |
|
|
|
|
backup_config v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
|
config |
|
|
|
@ -1534,10 +1508,10 @@ change_v2ray_id() { |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
change_domain() { |
|
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
while :; do |
|
|
|
|
echo |
|
|
|
|
echo -e "请输入一个 $magenta正确的域名$none,一定一定一定要正确,不!能!出!错!" |
|
|
|
|
echo -e "请输入一个 ${magenta}正确的域名${none},一定一定一定要正确,不!能!出!错!" |
|
|
|
|
read -p "$(echo -e "(当前域名: ${cyan}$domain$none):") " new_domain |
|
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
|
if [[ $new_domain == $domain ]]; then |
|
|
|
@ -1609,7 +1583,7 @@ change_domain() { |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
change_path_config() { |
|
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可" |
|
|
|
@ -1647,7 +1621,7 @@ change_path_config() { |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
# download_v2ray_config_ask |
|
|
|
|
elif [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
|
elif [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
path_config_ask |
|
|
|
|
if [[ $new_path ]]; then |
|
|
|
|
backup_config +path |
|
|
|
@ -1685,7 +1659,7 @@ change_path_config() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
change_proxy_site_config() { |
|
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入 ${magenta}一个正确的 $none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com" |
|
|
|
@ -1724,7 +1698,7 @@ change_proxy_site_config() { |
|
|
|
|
echo -e " 赶紧打开你的域名 ${cyan}https://${domain}$none 检查一下看看" |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
elif [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
|
elif [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
path_config_ask |
|
|
|
|
if [[ $new_path ]]; then |
|
|
|
|
backup_config +path |
|
|
|
@ -1763,9 +1737,9 @@ change_proxy_site_config() { |
|
|
|
|
} |
|
|
|
|
domain_check() { |
|
|
|
|
# test_domain=$(dig $new_domain +short) |
|
|
|
|
# test_domain=$(ping $new_domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
|
test_domain=$(ping $new_domain -c 1 -4 -W 2| grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
|
# test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
|
test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
|
# test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
|
if [[ $test_domain != $ip ]]; then |
|
|
|
|
echo |
|
|
|
|
echo -e "$red 检测域名解析错误....$none" |
|
|
|
@ -1780,7 +1754,7 @@ domain_check() { |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
disable_path() { |
|
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy && $is_path ]]; then |
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
while :; do |
|
|
|
@ -2201,7 +2175,35 @@ create_v2ray_config_text() { |
|
|
|
|
echo |
|
|
|
|
echo "路径 (path) = ${_path}" |
|
|
|
|
echo |
|
|
|
|
echo "TLS (Enable TLS) = 打开" |
|
|
|
|
echo "底层传输安全 (TLS) = tls" |
|
|
|
|
echo |
|
|
|
|
if [[ $ban_ad ]]; then |
|
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
|
|
echo |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport == 33 ]]; then |
|
|
|
|
echo |
|
|
|
|
echo '---提示..这是 VLESS 服务器配置---' |
|
|
|
|
echo |
|
|
|
|
echo "地址 (Address) = ${domain}" |
|
|
|
|
echo |
|
|
|
|
echo "端口 (Port) = 443" |
|
|
|
|
echo |
|
|
|
|
echo "用户ID (User ID / UUID) = ${v2ray_id}" |
|
|
|
|
echo |
|
|
|
|
echo "流控 (Flow) = 空" |
|
|
|
|
echo |
|
|
|
|
echo "加密 (Encryption) = none" |
|
|
|
|
echo |
|
|
|
|
echo "传输协议 (Network) = ${net}" |
|
|
|
|
echo |
|
|
|
|
echo "伪装类型 (header type) = ${header}" |
|
|
|
|
echo |
|
|
|
|
echo "伪装域名 (host) = ${domain}" |
|
|
|
|
echo |
|
|
|
|
echo "路径 (path) = ${_path}" |
|
|
|
|
echo |
|
|
|
|
echo "底层传输安全 (TLS) = tls" |
|
|
|
|
echo |
|
|
|
|
if [[ $ban_ad ]]; then |
|
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
|
@ -2223,10 +2225,10 @@ create_v2ray_config_text() { |
|
|
|
|
echo "伪装类型 (header type) = ${header}" |
|
|
|
|
echo |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 18 ]] && [[ $ban_ad ]]; then |
|
|
|
|
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]] && [[ $ban_ad ]]; then |
|
|
|
|
echo "备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
|
echo |
|
|
|
|
elif [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
elif [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then |
|
|
|
|
echo "备注: 动态端口已启用..." |
|
|
|
|
echo |
|
|
|
|
elif [[ $ban_ad ]]; then |
|
|
|
@ -2273,7 +2275,11 @@ get_v2ray_config_qr_link() { |
|
|
|
|
} |
|
|
|
|
get_v2ray_vmess_URL_link() { |
|
|
|
|
create_vmess_URL_config |
|
|
|
|
if [[ $v2ray_transport == 33 ]]; then |
|
|
|
|
local vmess="$(cat /etc/v2ray/vmess_qr.json)" |
|
|
|
|
else |
|
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" |
|
|
|
|
fi |
|
|
|
|
echo |
|
|
|
|
echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------" |
|
|
|
|
echo |
|
|
|
@ -2288,11 +2294,7 @@ other() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 1. $none安装 BBR" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 2. $none安装 LotServer(锐速)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 3. $none卸载 LotServer(锐速)" |
|
|
|
|
echo |
|
|
|
|
read -p "$(echo -e "请选择 [${magenta}1-3$none]:")" _opt |
|
|
|
|
read -p "$(echo -e "请选择 [${magenta}1$none]:")" _opt |
|
|
|
|
if [[ -z $_opt ]]; then |
|
|
|
|
error |
|
|
|
|
else |
|
|
|
@ -2301,14 +2303,6 @@ other() { |
|
|
|
|
install_bbr |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
2) |
|
|
|
|
install_lotserver |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
3) |
|
|
|
|
uninstall_lotserver |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
@ -2329,92 +2323,7 @@ install_bbr() { |
|
|
|
|
[[ ! $enable_bbr ]] && bash <(curl -s -L https://github.com/teddysun/across/raw/master/bbr.sh) |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
install_lotserver() { |
|
|
|
|
# https://moeclub.org/2017/03/08/14/ |
|
|
|
|
wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh" |
|
|
|
|
bash /tmp/appex.sh 'install' |
|
|
|
|
rm -rf /tmp/appex.sh |
|
|
|
|
} |
|
|
|
|
uninstall_lotserver() { |
|
|
|
|
# https://moeclub.org/2017/03/08/14/ |
|
|
|
|
wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh" |
|
|
|
|
bash /tmp/appex.sh 'uninstall' |
|
|
|
|
rm -rf /tmp/appex.sh |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
open_port() { |
|
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
if [[ $1 != "multiport" ]]; then |
|
|
|
|
# if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT |
|
|
|
|
iptables -I INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT |
|
|
|
|
ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT |
|
|
|
|
ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT |
|
|
|
|
|
|
|
|
|
# iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
# ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
# else |
|
|
|
|
# firewall-cmd --permanent --zone=public --add-port=$1/tcp |
|
|
|
|
# firewall-cmd --permanent --zone=public --add-port=$1/udp |
|
|
|
|
# firewall-cmd --reload |
|
|
|
|
# fi |
|
|
|
|
else |
|
|
|
|
# if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
local multiport="${v2ray_dynamic_port_start_input}:${v2ray_dynamic_port_end_input}" |
|
|
|
|
iptables -I INPUT -p tcp --match multiport --dports $multiport -j ACCEPT |
|
|
|
|
iptables -I INPUT -p udp --match multiport --dports $multiport -j ACCEPT |
|
|
|
|
ip6tables -I INPUT -p tcp --match multiport --dports $multiport -j ACCEPT |
|
|
|
|
ip6tables -I INPUT -p udp --match multiport --dports $multiport -j ACCEPT |
|
|
|
|
|
|
|
|
|
# iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
# ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
# else |
|
|
|
|
# local multi_port="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
|
# firewall-cmd --permanent --zone=public --add-port=$multi_port/tcp |
|
|
|
|
# firewall-cmd --permanent --zone=public --add-port=$multi_port/udp |
|
|
|
|
# firewall-cmd --reload |
|
|
|
|
# fi |
|
|
|
|
fi |
|
|
|
|
iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
# else |
|
|
|
|
# service iptables save >/dev/null 2>&1 |
|
|
|
|
# service ip6tables save >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
del_port() { |
|
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
if [[ $1 != "multiport" ]]; then |
|
|
|
|
# if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
iptables -D INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT |
|
|
|
|
iptables -D INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT |
|
|
|
|
ip6tables -D INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT |
|
|
|
|
ip6tables -D INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT |
|
|
|
|
# else |
|
|
|
|
# firewall-cmd --permanent --zone=public --remove-port=$1/tcp |
|
|
|
|
# firewall-cmd --permanent --zone=public --remove-port=$1/udp |
|
|
|
|
# fi |
|
|
|
|
else |
|
|
|
|
# if [[ $cmd == "apt-get" ]]; then |
|
|
|
|
local ports="${v2ray_dynamicPort_start}:${v2ray_dynamicPort_end}" |
|
|
|
|
iptables -D INPUT -p tcp --match multiport --dports $ports -j ACCEPT |
|
|
|
|
iptables -D INPUT -p udp --match multiport --dports $ports -j ACCEPT |
|
|
|
|
ip6tables -D INPUT -p tcp --match multiport --dports $ports -j ACCEPT |
|
|
|
|
ip6tables -D INPUT -p udp --match multiport --dports $ports -j ACCEPT |
|
|
|
|
# else |
|
|
|
|
# local ports="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}" |
|
|
|
|
# firewall-cmd --permanent --zone=public --remove-port=$ports/tcp |
|
|
|
|
# firewall-cmd --permanent --zone=public --remove-port=$ports/udp |
|
|
|
|
# fi |
|
|
|
|
fi |
|
|
|
|
iptables-save >/etc/iptables.rules.v4 |
|
|
|
|
ip6tables-save >/etc/iptables.rules.v6 |
|
|
|
|
# else |
|
|
|
|
# service iptables save >/dev/null 2>&1 |
|
|
|
|
# service ip6tables save >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
update() { |
|
|
|
|
while :; do |
|
|
|
|
echo |
|
|
|
@ -2819,7 +2728,7 @@ bt) |
|
|
|
|
;; |
|
|
|
|
status) |
|
|
|
|
echo |
|
|
|
|
if [[ $v2ray_transport == [45] && $caddy ]]; then |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
echo -e " V2Ray 状态: $v2ray_status / Caddy 状态: $caddy_run_status" |
|
|
|
|
else |
|
|
|
|
echo -e " V2Ray 状态: $v2ray_status" |
|
|
|
@ -2833,12 +2742,16 @@ stop) |
|
|
|
|
stop_v2ray |
|
|
|
|
;; |
|
|
|
|
restart) |
|
|
|
|
[[ $v2ray_transport == [45] && $caddy ]] && do_service restart caddy |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
do_service restart caddy |
|
|
|
|
fi |
|
|
|
|
restart_v2ray |
|
|
|
|
;; |
|
|
|
|
reload) |
|
|
|
|
config |
|
|
|
|
[[ $v2ray_transport == [45] && $caddy ]] && caddy_config |
|
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
caddy_config |
|
|
|
|
fi |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
;; |
|
|
|
|