|
|
@ -10,7 +10,7 @@ none='\e[0m' |
|
|
|
# Root |
|
|
|
# Root |
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
|
|
|
|
|
|
|
|
_version="v3.37" |
|
|
|
_version="v3.40" |
|
|
|
|
|
|
|
|
|
|
|
cmd="apt-get" |
|
|
|
cmd="apt-get" |
|
|
|
|
|
|
|
|
|
|
@ -69,7 +69,7 @@ fi |
|
|
|
if [[ $mark != "v3" ]]; then |
|
|
|
if [[ $mark != "v3" ]]; then |
|
|
|
. /etc/v2ray/233boy/v2ray/tools/v3.sh |
|
|
|
. /etc/v2ray/233boy/v2ray/tools/v3.sh |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then |
|
|
|
dynamicPort=true |
|
|
|
dynamicPort=true |
|
|
|
port_range="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}" |
|
|
|
port_range="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}" |
|
|
|
fi |
|
|
|
fi |
|
|
@ -103,7 +103,7 @@ if [ $v2ray_pid ]; then |
|
|
|
else |
|
|
|
else |
|
|
|
v2ray_status="$red未在运行$none" |
|
|
|
v2ray_status="$red未在运行$none" |
|
|
|
fi |
|
|
|
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" |
|
|
|
caddy_run_status="$green正在运行$none" |
|
|
|
else |
|
|
|
else |
|
|
|
caddy_run_status="$red未在运行$none" |
|
|
|
caddy_run_status="$red未在运行$none" |
|
|
@ -130,36 +130,36 @@ create_vmess_URL_config() { |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
{ |
|
|
|
{ |
|
|
|
"v": "2", |
|
|
|
"v": "2", |
|
|
|
"ps": "233v2.com_${domain}", |
|
|
|
"ps": "233v2.com_${domain}", |
|
|
|
"add": "${domain}", |
|
|
|
"add": "${domain}", |
|
|
|
"port": "443", |
|
|
|
"port": "443", |
|
|
|
"id": "${v2ray_id}", |
|
|
|
"id": "${v2ray_id}", |
|
|
|
"aid": "${alterId}", |
|
|
|
"aid": "${alterId}", |
|
|
|
"net": "${net}", |
|
|
|
"net": "${net}", |
|
|
|
"type": "none", |
|
|
|
"type": "none", |
|
|
|
"host": "${domain}", |
|
|
|
"host": "${domain}", |
|
|
|
"path": "$_path", |
|
|
|
"path": "$_path", |
|
|
|
"tls": "tls" |
|
|
|
"tls": "tls" |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
else |
|
|
|
else |
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
{ |
|
|
|
{ |
|
|
|
"v": "2", |
|
|
|
"v": "2", |
|
|
|
"ps": "233v2.com_${ip}", |
|
|
|
"ps": "233v2.com_${ip}", |
|
|
|
"add": "${ip}", |
|
|
|
"add": "${ip}", |
|
|
|
"port": "${v2ray_port}", |
|
|
|
"port": "${v2ray_port}", |
|
|
|
"id": "${v2ray_id}", |
|
|
|
"id": "${v2ray_id}", |
|
|
|
"aid": "${alterId}", |
|
|
|
"aid": "${alterId}", |
|
|
|
"net": "${net}", |
|
|
|
"net": "${net}", |
|
|
|
"type": "${header}", |
|
|
|
"type": "${header}", |
|
|
|
"host": "${host}", |
|
|
|
"host": "${host}", |
|
|
|
"path": "", |
|
|
|
"path": "", |
|
|
|
"tls": "" |
|
|
|
"tls": "" |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
@ -301,7 +301,6 @@ shadowsocks_config() { |
|
|
|
shadowsocks_password_config |
|
|
|
shadowsocks_password_config |
|
|
|
shadowsocks_ciphers_config |
|
|
|
shadowsocks_ciphers_config |
|
|
|
pause |
|
|
|
pause |
|
|
|
open_port $new_ssport |
|
|
|
|
|
|
|
backup_config +ss |
|
|
|
backup_config +ss |
|
|
|
ssport=$new_ssport |
|
|
|
ssport=$new_ssport |
|
|
|
sspass=$new_sspass |
|
|
|
sspass=$new_sspass |
|
|
@ -337,7 +336,7 @@ shadowsocks_port_config() { |
|
|
|
error |
|
|
|
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]) |
|
|
|
[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 |
|
|
|
local tls=ture |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
@ -455,7 +454,7 @@ change_shadowsocks_port() { |
|
|
|
error |
|
|
|
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]) |
|
|
|
[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 |
|
|
|
local tls=ture |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
|
if [[ $tls && $new_ssport == "80" ]] || [[ $tls && $new_ssport == "443" ]]; then |
|
|
@ -488,8 +487,6 @@ change_shadowsocks_port() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
pause |
|
|
|
pause |
|
|
|
backup_config ssport |
|
|
|
backup_config ssport |
|
|
|
del_port $ssport |
|
|
|
|
|
|
|
open_port $new_ssport |
|
|
|
|
|
|
|
ssport=$new_ssport |
|
|
|
ssport=$new_ssport |
|
|
|
config |
|
|
|
config |
|
|
|
clear |
|
|
|
clear |
|
|
@ -601,7 +598,6 @@ disable_shadowsocks() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
pause |
|
|
|
pause |
|
|
|
backup_config -ss |
|
|
|
backup_config -ss |
|
|
|
del_port $ssport |
|
|
|
|
|
|
|
shadowsocks='' |
|
|
|
shadowsocks='' |
|
|
|
config |
|
|
|
config |
|
|
|
# clear |
|
|
|
# clear |
|
|
@ -757,8 +753,6 @@ change_v2ray_port() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
pause |
|
|
|
pause |
|
|
|
backup_config v2ray_port |
|
|
|
backup_config v2ray_port |
|
|
|
del_port $v2ray_port |
|
|
|
|
|
|
|
open_port $v2ray_port_opt |
|
|
|
|
|
|
|
v2ray_port=$v2ray_port_opt |
|
|
|
v2ray_port=$v2ray_port_opt |
|
|
|
config |
|
|
|
config |
|
|
|
clear |
|
|
|
clear |
|
|
@ -838,7 +832,7 @@ change_v2ray_transport() { |
|
|
|
echo " 哎呀...跟当前传输协议一毛一样呀...修改个鸡鸡哦" |
|
|
|
echo " 哎呀...跟当前传输协议一毛一样呀...修改个鸡鸡哦" |
|
|
|
error |
|
|
|
error |
|
|
|
;; |
|
|
|
;; |
|
|
|
4 | 5) |
|
|
|
4 | 5 | 33) |
|
|
|
if [[ $v2ray_port == "80" || $v2ray_port == "443" ]]; then |
|
|
|
if [[ $v2ray_port == "80" || $v2ray_port == "443" ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 抱歉...如果你想要使用${cyan} ${transport[$v2ray_transport_opt - 1]} $none传输协议.. ${red}V2Ray 端口不能为 80 或者 443 ...$none" |
|
|
|
echo -e " 抱歉...如果你想要使用${cyan} ${transport[$v2ray_transport_opt - 1]} $none传输协议.. ${red}V2Ray 端口不能为 80 或者 443 ...$none" |
|
|
@ -872,7 +866,7 @@ change_v2ray_transport() { |
|
|
|
break |
|
|
|
break |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
[1-9] | [1-2][0-9] | 3[0-2]) |
|
|
|
[1-9] | [1-2][0-9] | 3[0-3]) |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
@ -889,14 +883,13 @@ change_v2ray_transport() { |
|
|
|
done |
|
|
|
done |
|
|
|
pause |
|
|
|
pause |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == [45] ]]; then |
|
|
|
if [[ $v2ray_transport_opt == [45] || $v2ray_transport_opt == 33 ]]; then |
|
|
|
tls_config |
|
|
|
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_start |
|
|
|
v2ray_dynamic_port_end |
|
|
|
v2ray_dynamic_port_end |
|
|
|
pause |
|
|
|
pause |
|
|
|
old_transport |
|
|
|
old_transport |
|
|
|
open_port "multiport" |
|
|
|
|
|
|
|
backup_config v2ray_transport v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
backup_config v2ray_transport v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
@ -916,9 +909,7 @@ change_v2ray_transport() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
old_transport() { |
|
|
|
old_transport() { |
|
|
|
if [[ $v2ray_transport == [45] ]]; then |
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]]; then |
|
|
|
del_port "80" |
|
|
|
|
|
|
|
del_port "443" |
|
|
|
|
|
|
|
if [[ $caddy && $caddy_pid ]]; then |
|
|
|
if [[ $caddy && $caddy_pid ]]; then |
|
|
|
do_service stop caddy |
|
|
|
do_service stop caddy |
|
|
|
if [[ $systemd ]]; then |
|
|
|
if [[ $systemd ]]; then |
|
|
@ -936,8 +927,6 @@ old_transport() { |
|
|
|
if [[ $is_path ]]; then |
|
|
|
if [[ $is_path ]]; then |
|
|
|
backup_config -path |
|
|
|
backup_config -path |
|
|
|
fi |
|
|
|
fi |
|
|
|
elif [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -946,7 +935,7 @@ tls_config() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "请输入一个 $magenta正确的域名$none,一定一定一定要正确,不!能!出!错!" |
|
|
|
echo -e "请输入一个 ${magenta}正确的域名${none},一定一定一定要正确,不!能!出!错!" |
|
|
|
read -p "(例如:233blog.com): " new_domain |
|
|
|
read -p "(例如:233blog.com): " new_domain |
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
echo |
|
|
|
echo |
|
|
@ -958,11 +947,11 @@ tls_config() { |
|
|
|
get_ip |
|
|
|
get_ip |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
@ -999,13 +988,8 @@ tls_config() { |
|
|
|
is_path=true |
|
|
|
is_path=true |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
domain=$new_domain |
|
|
|
domain=$new_domain |
|
|
|
|
|
|
|
|
|
|
|
open_port "80" |
|
|
|
|
|
|
|
open_port "443" |
|
|
|
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
if [[ $systemd ]]; then |
|
|
|
systemctl enable caddy >/dev/null 2>&1 |
|
|
|
systemctl enable caddy >/dev/null 2>&1 |
|
|
|
else |
|
|
|
else |
|
|
@ -1018,7 +1002,7 @@ tls_config() { |
|
|
|
view_v2ray_config_info |
|
|
|
view_v2ray_config_info |
|
|
|
# download_v2ray_config_ask |
|
|
|
# download_v2ray_config_ask |
|
|
|
else |
|
|
|
else |
|
|
|
if [[ $v2ray_transport_opt == 5 ]]; then |
|
|
|
if [[ $v2ray_transport_opt -ne 4 ]]; then |
|
|
|
path_config_ask |
|
|
|
path_config_ask |
|
|
|
pause |
|
|
|
pause |
|
|
|
domain_check |
|
|
|
domain_check |
|
|
@ -1029,13 +1013,8 @@ tls_config() { |
|
|
|
proxy_site=$new_proxy_site |
|
|
|
proxy_site=$new_proxy_site |
|
|
|
is_path=true |
|
|
|
is_path=true |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
domain=$new_domain |
|
|
|
domain=$new_domain |
|
|
|
install_caddy |
|
|
|
install_caddy |
|
|
|
open_port "80" |
|
|
|
|
|
|
|
open_port "443" |
|
|
|
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
caddy_config |
|
|
|
caddy_config |
|
|
|
config |
|
|
|
config |
|
|
@ -1085,13 +1064,8 @@ auto_tls_config() { |
|
|
|
proxy_site=$new_proxy_site |
|
|
|
proxy_site=$new_proxy_site |
|
|
|
is_path=true |
|
|
|
is_path=true |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
domain=$new_domain |
|
|
|
domain=$new_domain |
|
|
|
install_caddy |
|
|
|
install_caddy |
|
|
|
open_port "80" |
|
|
|
|
|
|
|
open_port "443" |
|
|
|
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
caddy_config |
|
|
|
caddy_config |
|
|
|
config |
|
|
|
config |
|
|
@ -1109,12 +1083,7 @@ auto_tls_config() { |
|
|
|
pause |
|
|
|
pause |
|
|
|
domain_check |
|
|
|
domain_check |
|
|
|
backup_config v2ray_transport domain |
|
|
|
backup_config v2ray_transport domain |
|
|
|
if [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
|
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
domain=$new_domain |
|
|
|
domain=$new_domain |
|
|
|
open_port "80" |
|
|
|
|
|
|
|
open_port "443" |
|
|
|
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
config |
|
|
|
config |
|
|
|
clear |
|
|
|
clear |
|
|
@ -1144,7 +1113,7 @@ path_config_ask() { |
|
|
|
N | n) |
|
|
|
N | n) |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 网站伪装 和 路径分流 = $cyan不想配置$none" |
|
|
|
echo -e "$yellow 网站伪装 和 路径分流 = $cyan 不想配置 $none" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
break |
|
|
|
break |
|
|
@ -1158,7 +1127,7 @@ path_config_ask() { |
|
|
|
path_config() { |
|
|
|
path_config() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可" |
|
|
|
echo -e "请输入想要 ${magenta}用来分流的路径 $none , 例如 /233blog , 那么只需要输入 233blog 即可" |
|
|
|
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" new_path |
|
|
|
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" new_path |
|
|
|
[[ -z $new_path ]] && new_path="233blog" |
|
|
|
[[ -z $new_path ]] && new_path="233blog" |
|
|
|
|
|
|
|
|
|
|
@ -1184,7 +1153,7 @@ path_config() { |
|
|
|
proxy_site_config() { |
|
|
|
proxy_site_config() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "请输入 ${magenta}一个正确的$none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com" |
|
|
|
echo -e "请输入 ${magenta}一个正确的 $none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com" |
|
|
|
echo -e "举例...假设你当前的域名是$green $domain $none, 伪装的网址的是 https://liyafly.com" |
|
|
|
echo -e "举例...假设你当前的域名是$green $domain $none, 伪装的网址的是 https://liyafly.com" |
|
|
|
echo -e "然后打开你的域名时候...显示出来的内容就是来自 https://liyafly.com 的内容" |
|
|
|
echo -e "然后打开你的域名时候...显示出来的内容就是来自 https://liyafly.com 的内容" |
|
|
|
echo -e "其实就是一个反代...明白就好..." |
|
|
|
echo -e "其实就是一个反代...明白就好..." |
|
|
@ -1340,12 +1309,10 @@ v2ray_dynamic_port_end() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
change_v2ray_dynamicport() { |
|
|
|
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_start |
|
|
|
change_v2ray_dynamic_port_end |
|
|
|
change_v2ray_dynamic_port_end |
|
|
|
pause |
|
|
|
pause |
|
|
|
del_port "multiport" |
|
|
|
|
|
|
|
open_port "multiport" |
|
|
|
|
|
|
|
backup_config v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
backup_config v2ray_dynamicPort_start v2ray_dynamicPort_end |
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" |
|
|
|
config |
|
|
|
config |
|
|
@ -1534,10 +1501,10 @@ change_v2ray_id() { |
|
|
|
done |
|
|
|
done |
|
|
|
} |
|
|
|
} |
|
|
|
change_domain() { |
|
|
|
change_domain() { |
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "请输入一个 $magenta正确的域名$none,一定一定一定要正确,不!能!出!错!" |
|
|
|
echo -e "请输入一个 ${magenta}正确的域名${none},一定一定一定要正确,不!能!出!错!" |
|
|
|
read -p "$(echo -e "(当前域名: ${cyan}$domain$none):") " new_domain |
|
|
|
read -p "$(echo -e "(当前域名: ${cyan}$domain$none):") " new_domain |
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
[ -z "$new_domain" ] && error && continue |
|
|
|
if [[ $new_domain == $domain ]]; then |
|
|
|
if [[ $new_domain == $domain ]]; then |
|
|
@ -1555,11 +1522,11 @@ change_domain() { |
|
|
|
get_ip |
|
|
|
get_ip |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow解析到: $cyan$ip$none" |
|
|
|
echo -e "$yellow 请将 $magenta$new_domain$none $yellow 解析到: $cyan$ip$none" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
@ -1609,7 +1576,7 @@ change_domain() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
change_path_config() { |
|
|
|
change_path_config() { |
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy && $is_path ]]; then |
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy && $is_path ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可" |
|
|
|
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可" |
|
|
@ -1647,7 +1614,7 @@ change_path_config() { |
|
|
|
clear |
|
|
|
clear |
|
|
|
view_v2ray_config_info |
|
|
|
view_v2ray_config_info |
|
|
|
# download_v2ray_config_ask |
|
|
|
# download_v2ray_config_ask |
|
|
|
elif [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
elif [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
path_config_ask |
|
|
|
path_config_ask |
|
|
|
if [[ $new_path ]]; then |
|
|
|
if [[ $new_path ]]; then |
|
|
|
backup_config +path |
|
|
|
backup_config +path |
|
|
@ -1685,10 +1652,10 @@ change_path_config() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
change_proxy_site_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 |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "请输入 ${magenta}一个正确的$none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com" |
|
|
|
echo -e "请输入 ${magenta}一个正确的 $none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com" |
|
|
|
echo -e "举例...你当前的域名是$green $domain $none, 伪装的网址的是 https://liyafly.com" |
|
|
|
echo -e "举例...你当前的域名是$green $domain $none, 伪装的网址的是 https://liyafly.com" |
|
|
|
echo -e "然后打开你的域名时候...显示出来的内容就是来自 https://liyafly.com 的内容" |
|
|
|
echo -e "然后打开你的域名时候...显示出来的内容就是来自 https://liyafly.com 的内容" |
|
|
|
echo -e "其实就是一个反代...明白就好..." |
|
|
|
echo -e "其实就是一个反代...明白就好..." |
|
|
@ -1724,7 +1691,7 @@ change_proxy_site_config() { |
|
|
|
echo -e " 赶紧打开你的域名 ${cyan}https://${domain}$none 检查一下看看" |
|
|
|
echo -e " 赶紧打开你的域名 ${cyan}https://${domain}$none 检查一下看看" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
elif [[ $v2ray_transport == [45] ]] && [[ $caddy ]]; then |
|
|
|
elif [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
path_config_ask |
|
|
|
path_config_ask |
|
|
|
if [[ $new_path ]]; then |
|
|
|
if [[ $new_path ]]; then |
|
|
|
backup_config +path |
|
|
|
backup_config +path |
|
|
@ -1780,7 +1747,7 @@ domain_check() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
disable_path() { |
|
|
|
disable_path() { |
|
|
|
if [[ $v2ray_transport == [45] ]] && [[ $caddy && $is_path ]]; then |
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy && $is_path ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
while :; do |
|
|
|
while :; do |
|
|
@ -2201,7 +2168,35 @@ create_v2ray_config_text() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "路径 (path) = ${_path}" |
|
|
|
echo "路径 (path) = ${_path}" |
|
|
|
echo |
|
|
|
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 |
|
|
|
echo |
|
|
|
if [[ $ban_ad ]]; then |
|
|
|
if [[ $ban_ad ]]; then |
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
@ -2223,10 +2218,10 @@ create_v2ray_config_text() { |
|
|
|
echo "伪装类型 (header type) = ${header}" |
|
|
|
echo "伪装类型 (header type) = ${header}" |
|
|
|
echo |
|
|
|
echo |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $v2ray_transport -ge 18 ]] && [[ $ban_ad ]]; then |
|
|
|
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]] && [[ $ban_ad ]]; then |
|
|
|
echo "备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
echo "备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
echo |
|
|
|
echo |
|
|
|
elif [[ $v2ray_transport -ge 18 ]]; then |
|
|
|
elif [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then |
|
|
|
echo "备注: 动态端口已启用..." |
|
|
|
echo "备注: 动态端口已启用..." |
|
|
|
echo |
|
|
|
echo |
|
|
|
elif [[ $ban_ad ]]; then |
|
|
|
elif [[ $ban_ad ]]; then |
|
|
@ -2342,79 +2337,6 @@ uninstall_lotserver() { |
|
|
|
rm -rf /tmp/appex.sh |
|
|
|
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() { |
|
|
|
update() { |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo |
|
|
|
echo |
|
|
@ -2618,7 +2540,7 @@ error() { |
|
|
|
|
|
|
|
|
|
|
|
pause() { |
|
|
|
pause() { |
|
|
|
|
|
|
|
|
|
|
|
read -rsp "$(echo -e "按$green Enter 回车键 $none继续....或按$red Ctrl + C $none取消.")" -d $'\n' |
|
|
|
read -rsp "$(echo -e "按 $green Enter 回车键 $none 继续....或按 $red Ctrl + C $none 取消.")" -d $'\n' |
|
|
|
echo |
|
|
|
echo |
|
|
|
} |
|
|
|
} |
|
|
|
do_service() { |
|
|
|
do_service() { |
|
|
@ -2819,7 +2741,7 @@ bt) |
|
|
|
;; |
|
|
|
;; |
|
|
|
status) |
|
|
|
status) |
|
|
|
echo |
|
|
|
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" |
|
|
|
echo -e " V2Ray 状态: $v2ray_status / Caddy 状态: $caddy_run_status" |
|
|
|
else |
|
|
|
else |
|
|
|
echo -e " V2Ray 状态: $v2ray_status" |
|
|
|
echo -e " V2Ray 状态: $v2ray_status" |
|
|
@ -2833,12 +2755,16 @@ stop) |
|
|
|
stop_v2ray |
|
|
|
stop_v2ray |
|
|
|
;; |
|
|
|
;; |
|
|
|
restart) |
|
|
|
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 |
|
|
|
restart_v2ray |
|
|
|
;; |
|
|
|
;; |
|
|
|
reload) |
|
|
|
reload) |
|
|
|
config |
|
|
|
config |
|
|
|
[[ $v2ray_transport == [45] && $caddy ]] && caddy_config |
|
|
|
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]] && [[ $caddy ]]; then |
|
|
|
|
|
|
|
caddy_config |
|
|
|
|
|
|
|
fi |
|
|
|
clear |
|
|
|
clear |
|
|
|
view_v2ray_config_info |
|
|
|
view_v2ray_config_info |
|
|
|
;; |
|
|
|
;; |
|
|
@ -2849,6 +2775,12 @@ log) |
|
|
|
view_v2ray_log |
|
|
|
view_v2ray_log |
|
|
|
;; |
|
|
|
;; |
|
|
|
url | URL) |
|
|
|
url | URL) |
|
|
|
|
|
|
|
if [[ $v2ray_transport == 33 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo ' V2RAY VLESS 协议相关暂不支持生成 URL ....' |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
exit |
|
|
|
|
|
|
|
fi |
|
|
|
get_v2ray_vmess_URL_link |
|
|
|
get_v2ray_vmess_URL_link |
|
|
|
;; |
|
|
|
;; |
|
|
|
u | update) |
|
|
|
u | update) |
|
|
|