|
|
@ -62,6 +62,8 @@ transport=( |
|
|
|
mKCP_utp_dynamicPort |
|
|
|
mKCP_utp_dynamicPort |
|
|
|
mKCP_srtp_dynamicPort |
|
|
|
mKCP_srtp_dynamicPort |
|
|
|
mKCP_wechat-video_dynamicPort |
|
|
|
mKCP_wechat-video_dynamicPort |
|
|
|
|
|
|
|
HTTP/2 |
|
|
|
|
|
|
|
Socks5 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
ciphers=( |
|
|
|
ciphers=( |
|
|
@ -97,7 +99,7 @@ v2ray_config() { |
|
|
|
read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport_opt |
|
|
|
read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport_opt |
|
|
|
[ -z "$v2ray_transport_opt" ] && v2ray_transport_opt=1 |
|
|
|
[ -z "$v2ray_transport_opt" ] && v2ray_transport_opt=1 |
|
|
|
case $v2ray_transport_opt in |
|
|
|
case $v2ray_transport_opt in |
|
|
|
[1-9] | 1[0-5]) |
|
|
|
[1-9] | 1[0-7]) |
|
|
|
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" |
|
|
@ -113,7 +115,8 @@ v2ray_config() { |
|
|
|
v2ray_port_config |
|
|
|
v2ray_port_config |
|
|
|
} |
|
|
|
} |
|
|
|
v2ray_port_config() { |
|
|
|
v2ray_port_config() { |
|
|
|
if [[ $v2ray_transport_opt -ne 4 && $v2ray_transport_opt -lt 9 ]]; then |
|
|
|
case $v2ray_transport_opt in |
|
|
|
|
|
|
|
[1-3] | [5-9] | 1[0-5] | 17) |
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]" |
|
|
|
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]" |
|
|
@ -133,42 +136,17 @@ v2ray_port_config() { |
|
|
|
;; |
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 ]]; then |
|
|
|
v2ray_dynamic_port_start |
|
|
|
|
|
|
|
elif [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
v2ray_dynamic_port_config |
|
|
|
socks_user_config |
|
|
|
|
|
|
|
socks_pass_config |
|
|
|
else |
|
|
|
fi |
|
|
|
|
|
|
|
;; |
|
|
|
ws_config |
|
|
|
*) |
|
|
|
|
|
|
|
tls_config |
|
|
|
fi |
|
|
|
;; |
|
|
|
} |
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
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}${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] | 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" |
|
|
|
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
*) |
|
|
|
|
|
|
|
error |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v2ray_dynamic_port_start |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
v2ray_dynamic_port_start() { |
|
|
|
v2ray_dynamic_port_start() { |
|
|
@ -239,7 +217,53 @@ v2ray_dynamic_port_end() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ws_config() { |
|
|
|
socks_user_config() { |
|
|
|
|
|
|
|
while :; do |
|
|
|
|
|
|
|
read -p "$(echo -e "请输入$yellow用户名$none...(默认用户名: ${cyan}233blog$none)"): " username |
|
|
|
|
|
|
|
[ -z "$username" ] && username="233blog" |
|
|
|
|
|
|
|
case $username in |
|
|
|
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
error |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
*) |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 用户名 = $cyan$username$none" |
|
|
|
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
socks_pass_config() { |
|
|
|
|
|
|
|
while :; do |
|
|
|
|
|
|
|
read -p "$(echo -e "请输入$yellow密码$none...(默认密码: ${cyan}233blog.com$none)"): " userpass |
|
|
|
|
|
|
|
[ -z "$userpass" ] && userpass="233blog.com" |
|
|
|
|
|
|
|
case $userpass in |
|
|
|
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
error |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
*) |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 密码 = $cyan$userpass$none" |
|
|
|
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tls_config() { |
|
|
|
|
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
|
local random=$(shuf -i20001-65535 -n1) |
|
|
@ -314,6 +338,18 @@ ws_config() { |
|
|
|
|
|
|
|
|
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt -ne 16 ]]; then |
|
|
|
|
|
|
|
auto_tls_config |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
caddy=true |
|
|
|
|
|
|
|
install_caddy_info="打开" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $caddy ]]; then |
|
|
|
|
|
|
|
path_config_ask |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
auto_tls_config() { |
|
|
|
echo -e " |
|
|
|
echo -e " |
|
|
|
|
|
|
|
|
|
|
|
安装 Caddy 来实现 自动配置 TLS |
|
|
|
安装 Caddy 来实现 自动配置 TLS |
|
|
@ -356,20 +392,17 @@ ws_config() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
done |
|
|
|
done |
|
|
|
if [[ $caddy ]]; then |
|
|
|
|
|
|
|
ws_path_config_ask |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
ws_path_config_ask() { |
|
|
|
path_config_ask() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]" |
|
|
|
echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]" |
|
|
|
read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_ws_path |
|
|
|
read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_path |
|
|
|
[[ -z $is_ws_path ]] && is_ws_path="n" |
|
|
|
[[ -z $is_path ]] && is_path="n" |
|
|
|
|
|
|
|
|
|
|
|
case $is_ws_path in |
|
|
|
case $is_path in |
|
|
|
Y | y) |
|
|
|
Y | y) |
|
|
|
ws_path_config |
|
|
|
path_config |
|
|
|
break |
|
|
|
break |
|
|
|
;; |
|
|
|
;; |
|
|
|
N | n) |
|
|
|
N | n) |
|
|
@ -386,14 +419,14 @@ ws_path_config_ask() { |
|
|
|
esac |
|
|
|
esac |
|
|
|
done |
|
|
|
done |
|
|
|
} |
|
|
|
} |
|
|
|
ws_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]):")" ws_path |
|
|
|
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" path |
|
|
|
[[ -z $ws_path ]] && ws_path="233blog" |
|
|
|
[[ -z $path ]] && path="233blog" |
|
|
|
|
|
|
|
|
|
|
|
case $ws_path in |
|
|
|
case $path in |
|
|
|
*[/$]*) |
|
|
|
*[/$]*) |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... " |
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... " |
|
|
@ -403,7 +436,7 @@ ws_path_config() { |
|
|
|
*) |
|
|
|
*) |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 分流的路径 = ${cyan}/${ws_path}$none" |
|
|
|
echo -e "$yellow 分流的路径 = ${cyan}/${path}$none" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
break |
|
|
|
break |
|
|
@ -511,9 +544,12 @@ 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_opt == "4" && $ssport == "80" ]] || [[ $v2ray_transport_opt == "4" && $ssport == "443" ]]; then |
|
|
|
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == "16" ]]; then |
|
|
|
|
|
|
|
local tls=ture |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if [[ $tls && $ssport == "80" ]] || [[ $tls && $ssport == "443" ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "由于你选择了 "$green"WebSocket + TLS"$none" 传输协议." |
|
|
|
echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议." |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口" |
|
|
|
echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口" |
|
|
|
error |
|
|
|
error |
|
|
@ -612,7 +648,7 @@ install_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == "4" ]]; then |
|
|
|
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
echo |
|
|
|
echo |
|
|
@ -626,16 +662,28 @@ install_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" |
|
|
|
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
if [[ $path ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 路径分流 = ${cyan}/${ws_path}$none" |
|
|
|
echo -e "$yellow 路径分流 = ${cyan}/${path}$none" |
|
|
|
fi |
|
|
|
fi |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 ]]; then |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow V2Ray 动态端口范围 = $cyan${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}$none" |
|
|
|
echo -e "$yellow V2Ray 动态端口范围 = $cyan${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}$none" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
elif [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 用户名 = $cyan$username$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 密码 = $cyan$userpass$none" |
|
|
|
|
|
|
|
|
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" |
|
|
|
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" |
|
|
@ -740,23 +788,25 @@ install_caddy() { |
|
|
|
} |
|
|
|
} |
|
|
|
caddy_config() { |
|
|
|
caddy_config() { |
|
|
|
local email=$(shuf -i1-10000000000 -n1) |
|
|
|
local email=$(shuf -i1-10000000000 -n1) |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
case $v2ray_transport_opt in |
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
4) |
|
|
|
|
|
|
|
if [[ $path ]]; then |
|
|
|
|
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
$domain { |
|
|
|
$domain { |
|
|
|
tls ${email}@gmail.com |
|
|
|
tls ${email}@gmail.com |
|
|
|
gzip |
|
|
|
gzip |
|
|
|
timeouts none |
|
|
|
timeouts none |
|
|
|
proxy / $proxy_site { |
|
|
|
proxy / $proxy_site { |
|
|
|
without /${ws_path} |
|
|
|
without /${path} |
|
|
|
} |
|
|
|
} |
|
|
|
proxy /${ws_path} 127.0.0.1:${v2ray_port} { |
|
|
|
proxy /${path} 127.0.0.1:${v2ray_port} { |
|
|
|
without /${ws_path} |
|
|
|
without /${path} |
|
|
|
websocket |
|
|
|
websocket |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
else |
|
|
|
else |
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
$domain { |
|
|
|
$domain { |
|
|
|
tls ${email}@gmail.com |
|
|
|
tls ${email}@gmail.com |
|
|
|
timeouts none |
|
|
|
timeouts none |
|
|
@ -765,7 +815,41 @@ $domain { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
if [[ $path ]]; then |
|
|
|
|
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
|
|
|
|
$domain { |
|
|
|
|
|
|
|
tls ${email}@gmail.com |
|
|
|
|
|
|
|
gzip |
|
|
|
|
|
|
|
timeouts none |
|
|
|
|
|
|
|
proxy / $proxy_site { |
|
|
|
|
|
|
|
without /${path} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
proxy /${path} https://127.0.0.1:${v2ray_port} { |
|
|
|
|
|
|
|
header_upstream Host {host} |
|
|
|
|
|
|
|
header_upstream X-Forwarded-Proto {scheme} |
|
|
|
|
|
|
|
insecure_skip_verify |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
cat >/etc/caddy/Caddyfile <<-EOF |
|
|
|
|
|
|
|
$domain { |
|
|
|
|
|
|
|
tls ${email}@gmail.com |
|
|
|
|
|
|
|
timeouts none |
|
|
|
|
|
|
|
proxy / https://127.0.0.1:${v2ray_port} { |
|
|
|
|
|
|
|
header_upstream Host {host} |
|
|
|
|
|
|
|
header_upstream X-Forwarded-Proto {scheme} |
|
|
|
|
|
|
|
insecure_skip_verify |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
# systemctl restart caddy |
|
|
|
# systemctl restart caddy |
|
|
|
do_service restart caddy |
|
|
|
do_service restart caddy |
|
|
@ -784,6 +868,7 @@ install_v2ray() { |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services |
|
|
|
fi |
|
|
|
fi |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
|
|
|
|
[ -d /etc/v2ray ] && rm -rf /etc/v2ray |
|
|
|
|
|
|
|
|
|
|
|
if [[ $local_install ]]; then |
|
|
|
if [[ $local_install ]]; then |
|
|
|
if [[ ! -d $(pwd)/config ]]; then |
|
|
|
if [[ ! -d $(pwd)/config ]]; then |
|
|
@ -874,6 +959,14 @@ install_v2ray() { |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_ss_dynamic.json" |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_ss_dynamic.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2_ss.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
17) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks_ss.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
else |
|
|
|
else |
|
|
|
case $v2ray_transport_opt in |
|
|
|
case $v2ray_transport_opt in |
|
|
@ -913,6 +1006,14 @@ install_v2ray() { |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_ss_dynamic.json" |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_ss_dynamic.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2_ss.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
17) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks_ss.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
fi |
|
|
|
fi |
|
|
|
else |
|
|
|
else |
|
|
@ -954,6 +1055,14 @@ install_v2ray() { |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_dynamic.json" |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_dynamic.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
17) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
else |
|
|
|
else |
|
|
|
case $v2ray_transport_opt in |
|
|
|
case $v2ray_transport_opt in |
|
|
@ -993,6 +1102,14 @@ install_v2ray() { |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_dynamic.json" |
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_dynamic.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json" |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
17) |
|
|
|
|
|
|
|
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks.json" |
|
|
|
|
|
|
|
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
@ -1092,7 +1209,7 @@ config() { |
|
|
|
sed -i "28s/6666/$ssport/; 30s/chacha20-ietf/$ssciphers/; 31s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
sed -i "28s/6666/$ssport/; 30s/chacha20-ietf/$ssciphers/; 31s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
2) |
|
|
|
2) |
|
|
|
sed -i "50s/6666/$ssport/; 52s/chacha20-ietf/$ssciphers/; 53s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
sed -i "64s/6666/$ssport/; 66s/chacha20-ietf/$ssciphers/; 67s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
3 | 4) |
|
|
|
3 | 4) |
|
|
|
sed -i "31s/6666/$ssport/; 33s/chacha20-ietf/$ssciphers/; 34s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
sed -i "31s/6666/$ssport/; 33s/chacha20-ietf/$ssciphers/; 34s/233blog.com/$sspass/" $v2ray_server_config |
|
|
@ -1106,10 +1223,15 @@ config() { |
|
|
|
10) |
|
|
|
10) |
|
|
|
sed -i "67s/6666/$ssport/; 69s/chacha20-ietf/$ssciphers/; 70s/233blog.com/$sspass/; 78s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
sed -i "67s/6666/$ssport/; 69s/chacha20-ietf/$ssciphers/; 70s/233blog.com/$sspass/; 78s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
*) |
|
|
|
1[1-5]) |
|
|
|
|
|
|
|
|
|
|
|
sed -i "34s/6666/$ssport/; 36s/chacha20-ietf/$ssciphers/; 37s/233blog.com/$sspass/; 45s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
sed -i "34s/6666/$ssport/; 36s/chacha20-ietf/$ssciphers/; 37s/233blog.com/$sspass/; 45s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
17) |
|
|
|
|
|
|
|
sed -i "30s/6666/$ssport/; 32s/chacha20-ietf/$ssciphers/; 33s/233blog.com/$sspass/" $v2ray_server_config |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
case $v2ray_transport_opt in |
|
|
|
case $v2ray_transport_opt in |
|
|
@ -1147,7 +1269,7 @@ config() { |
|
|
|
10) |
|
|
|
10) |
|
|
|
sed -i "67s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
sed -i "67s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
11 | 12 | 13 | 14 | 15) |
|
|
|
1[1-5]) |
|
|
|
sed -i "34s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
sed -i "34s/10000-20000/$multi_port/" $v2ray_server_config |
|
|
|
;; |
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
@ -1181,20 +1303,35 @@ config() { |
|
|
|
|
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$uuid/" $v2ray_server_config |
|
|
|
if [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
sed -i "8s/2333/$v2ray_port/; 14s/233blog/$username/; 15s/233blog.com/$userpass/" $v2ray_server_config |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$uuid/" $v2ray_server_config |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt -eq 16 ]]; then |
|
|
|
|
|
|
|
sed -i "24s/233blog.com/$domain/" $v2ray_server_config |
|
|
|
|
|
|
|
if [[ $path ]]; then |
|
|
|
|
|
|
|
sed -i "26s/233blog/$path/" $v2ray_server_config |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
sed -i "26s/233blog//" $v2ray_server_config |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt -eq 4 ]]; then |
|
|
|
if [[ $v2ray_transport_opt -eq 4 || $v2ray_transport_opt -eq 16 ]]; then |
|
|
|
sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$uuid/" $v2ray_client_config |
|
|
|
sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$uuid/" $v2ray_client_config |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
if [[ $path ]]; then |
|
|
|
sed -i "41s/233blog/$ws_path/" $v2ray_client_config |
|
|
|
sed -i "40s/233blog/$path/" $v2ray_client_config |
|
|
|
else |
|
|
|
else |
|
|
|
sed -i "41s/233blog//" $v2ray_client_config |
|
|
|
sed -i "40s/233blog//" $v2ray_client_config |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
elif [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
sed -i "21s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/233blog/$username/; 26s/233blog.com/$userpass/" $v2ray_client_config |
|
|
|
else |
|
|
|
else |
|
|
|
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$uuid/" $v2ray_client_config |
|
|
|
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$uuid/" $v2ray_client_config |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config |
|
|
|
# zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config |
|
|
|
|
|
|
|
|
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
cat >/etc/network/if-pre-up.d/iptables <<-EOF |
|
|
|
cat >/etc/network/if-pre-up.d/iptables <<-EOF |
|
|
@ -1214,11 +1351,11 @@ config() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
[ $shadowsocks ] && open_port $ssport |
|
|
|
[ $shadowsocks ] && open_port $ssport |
|
|
|
if [[ $v2ray_transport_opt == "4" ]]; then |
|
|
|
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then |
|
|
|
open_port "80" |
|
|
|
open_port "80" |
|
|
|
open_port "443" |
|
|
|
open_port "443" |
|
|
|
open_port $v2ray_port |
|
|
|
open_port $v2ray_port |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 ]]; then |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then |
|
|
|
open_port $v2ray_port |
|
|
|
open_port $v2ray_port |
|
|
|
open_port "multiport" |
|
|
|
open_port "multiport" |
|
|
|
else |
|
|
|
else |
|
|
@ -1232,20 +1369,22 @@ config() { |
|
|
|
|
|
|
|
|
|
|
|
backup_config() { |
|
|
|
backup_config() { |
|
|
|
sed -i "18s/=1/=$v2ray_transport_opt/; 21s/=2333/=$v2ray_port/; 24s/=$old_id/=$uuid/" $backup |
|
|
|
sed -i "18s/=1/=$v2ray_transport_opt/; 21s/=2333/=$v2ray_port/; 24s/=$old_id/=$uuid/" $backup |
|
|
|
if [ $v2ray_transport_opt -ge 9 ]; then |
|
|
|
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then |
|
|
|
sed -i "30s/=10000/=$v2ray_dynamic_port_start_input/; 33s/=20000/=$v2ray_dynamic_port_end_input/" $backup |
|
|
|
sed -i "30s/=10000/=$v2ray_dynamic_port_start_input/; 33s/=20000/=$v2ray_dynamic_port_end_input/" $backup |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [ $shadowsocks ]; then |
|
|
|
if [ $shadowsocks ]; then |
|
|
|
sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup |
|
|
|
sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup |
|
|
|
fi |
|
|
|
fi |
|
|
|
[ $v2ray_transport_opt == "4" ] && sed -i "36s/=233blog.com/=$domain/" $backup |
|
|
|
[[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]] && sed -i "36s/=233blog.com/=$domain/" $backup |
|
|
|
[ $caddy ] && sed -i "39s/=/=true/" $backup |
|
|
|
[ $caddy ] && sed -i "39s/=/=true/" $backup |
|
|
|
[ $is_blocked_ad ] && sed -i "54s/=/=true/" $backup |
|
|
|
[ $is_blocked_ad ] && sed -i "54s/=/=true/" $backup |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
if [[ $path ]]; then |
|
|
|
sed -i "57s/=/=true/; 60s/=233blog/=$ws_path/" $backup |
|
|
|
sed -i "57s/=/=true/; 60s/=233blog/=$path/" $backup |
|
|
|
sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup |
|
|
|
sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
sed -i "66s/=233blog/=$username/; 69s/=233blog.com/=$userpass/" $backup |
|
|
|
|
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try_enable_bbr() { |
|
|
|
try_enable_bbr() { |
|
|
@ -1286,53 +1425,58 @@ do_service() { |
|
|
|
} |
|
|
|
} |
|
|
|
show_config_info() { |
|
|
|
show_config_info() { |
|
|
|
local header="none" |
|
|
|
local header="none" |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
if [[ $path ]]; then |
|
|
|
local host="/$ws_path" |
|
|
|
local _path="/$path" |
|
|
|
else |
|
|
|
else |
|
|
|
local host="" |
|
|
|
local _path="/" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
case $v2ray_transport_opt in |
|
|
|
case $v2ray_transport_opt in |
|
|
|
1 | 9) |
|
|
|
1 | 9) |
|
|
|
local net="tcp" |
|
|
|
local net="tcp" |
|
|
|
local network="tcp" |
|
|
|
# local network="tcp" |
|
|
|
local obfs="none" |
|
|
|
# local obfs="none" |
|
|
|
;; |
|
|
|
;; |
|
|
|
2 | 10) |
|
|
|
2 | 10) |
|
|
|
local net="tcp" |
|
|
|
local net="tcp" |
|
|
|
local network="tcp" |
|
|
|
# local network="tcp" |
|
|
|
local header="http" |
|
|
|
local header="http" |
|
|
|
local host="www.baidu.com" |
|
|
|
local host="www.baidu.com" |
|
|
|
local obfs="http" |
|
|
|
# local obfs="http" |
|
|
|
;; |
|
|
|
;; |
|
|
|
3 | 4 | 11) |
|
|
|
3 | 4 | 11) |
|
|
|
local net="ws" |
|
|
|
local net="ws" |
|
|
|
local network="ws (WebSocket)" |
|
|
|
# local network="ws" |
|
|
|
local obfs="websocket" |
|
|
|
# local obfs="websocket" |
|
|
|
;; |
|
|
|
;; |
|
|
|
5 | 12) |
|
|
|
5 | 12) |
|
|
|
local net="kcp" |
|
|
|
local net="kcp" |
|
|
|
local network="kcp" |
|
|
|
# local network="kcp" |
|
|
|
;; |
|
|
|
;; |
|
|
|
6 | 13) |
|
|
|
6 | 13) |
|
|
|
local net="kcp" |
|
|
|
local net="kcp" |
|
|
|
local network="kcp" |
|
|
|
# local network="kcp" |
|
|
|
local header="utp" |
|
|
|
local header="utp" |
|
|
|
;; |
|
|
|
;; |
|
|
|
7 | 14) |
|
|
|
7 | 14) |
|
|
|
local net="kcp" |
|
|
|
local net="kcp" |
|
|
|
local network="kcp" |
|
|
|
# local network="kcp" |
|
|
|
local header="srtp" |
|
|
|
local header="srtp" |
|
|
|
;; |
|
|
|
;; |
|
|
|
8 | 15) |
|
|
|
8 | 15) |
|
|
|
local net="kcp" |
|
|
|
local net="kcp" |
|
|
|
local network="kcp" |
|
|
|
# local network="kcp" |
|
|
|
local header="wechat-video" |
|
|
|
local header="wechat-video" |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
16) |
|
|
|
|
|
|
|
local net="h2" |
|
|
|
|
|
|
|
# local network="h2" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
if [[ $v2ray_transport_opt == "4" ]]; then |
|
|
|
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
"v": "2", |
|
|
|
"ps": "233blog_v2ray_${domain}", |
|
|
|
"ps": "233blog_v2ray_${domain}", |
|
|
|
"add": "${domain}", |
|
|
|
"add": "${domain}", |
|
|
|
"port": "443", |
|
|
|
"port": "443", |
|
|
@ -1340,13 +1484,15 @@ show_config_info() { |
|
|
|
"aid": "233", |
|
|
|
"aid": "233", |
|
|
|
"net": "${net}", |
|
|
|
"net": "${net}", |
|
|
|
"type": "none", |
|
|
|
"type": "none", |
|
|
|
"host": "${host}", |
|
|
|
"host": "${domain}", |
|
|
|
|
|
|
|
"path": "$_path", |
|
|
|
"tls": "tls" |
|
|
|
"tls": "tls" |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
else |
|
|
|
elif [[ $v2ray_transport_opt != 17 ]]; then |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
cat >/etc/v2ray/vmess_qr.json <<-EOF |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
"v": "2", |
|
|
|
"ps": "233blog_v2ray_${ip}", |
|
|
|
"ps": "233blog_v2ray_${ip}", |
|
|
|
"add": "${ip}", |
|
|
|
"add": "${ip}", |
|
|
|
"port": "${v2ray_port}", |
|
|
|
"port": "${v2ray_port}", |
|
|
@ -1355,20 +1501,11 @@ show_config_info() { |
|
|
|
"net": "${net}", |
|
|
|
"net": "${net}", |
|
|
|
"type": "${header}", |
|
|
|
"type": "${header}", |
|
|
|
"host": "${host}", |
|
|
|
"host": "${host}", |
|
|
|
|
|
|
|
"path": "", |
|
|
|
"tls": "" |
|
|
|
"tls": "" |
|
|
|
} |
|
|
|
} |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $obfs ]]; then |
|
|
|
|
|
|
|
if [[ $domain ]]; then |
|
|
|
|
|
|
|
ip_or_domain=$domain |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
ip_or_domain=$ip |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${uuid}@${ip_or_domain}:${v2ray_port}" | base64)?remarks=233blog_v2ray_${ip_or_domain}&obfs=${obfs}" |
|
|
|
|
|
|
|
echo "${shadowray_qr}" >/etc/v2ray/shadowray_qr.txt |
|
|
|
|
|
|
|
sed -i 'N;s/\n//' /etc/v2ray/shadowray_qr.txt |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
clear |
|
|
|
clear |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "---------- V2Ray 安装完成 -------------" |
|
|
|
echo "---------- V2Ray 安装完成 -------------" |
|
|
@ -1382,7 +1519,7 @@ show_config_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
fi |
|
|
|
fi |
|
|
|
echo "---------- V2Ray 配置信息 -------------" |
|
|
|
echo "---------- V2Ray 配置信息 -------------" |
|
|
|
if [[ $v2ray_transport_opt == "4" ]]; then |
|
|
|
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 地址 (Address) = $cyan${domain}$none" |
|
|
|
echo -e "$yellow 地址 (Address) = $cyan${domain}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
@ -1392,19 +1529,30 @@ show_config_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 额外ID (Alter Id) = ${cyan}233${none}" |
|
|
|
echo -e "$yellow 额外ID (Alter Id) = ${cyan}233${none}" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 传输协议 (Network) = ${cyan}${network}$none" |
|
|
|
echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" |
|
|
|
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
if [[ $ws_path ]]; then |
|
|
|
echo -e "$yellow 伪装域名 (host) = ${cyan}${domain}$none" |
|
|
|
echo -e "$yellow WebSocket 路径 (WS path) = ${cyan}/${ws_path}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 路径 (path) = ${cyan}${_path}$none" |
|
|
|
fi |
|
|
|
echo |
|
|
|
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none" |
|
|
|
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
elif [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 主机 (Hostname) = $cyan${ip}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 端口 (Port) = $cyan$v2ray_port$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 用户名 (Username) = $cyan${username}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 密码 (Password) = $cyan${userpass}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow Telegram 代理配置链接 = ${cyan}tg://socks?server=${ip}&port=${v2ray_port}&user=${username}&pass=${userpass}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo " 这是 Socks5 协议相关的配置啦.... 不用在乎一些 V2Ray 客户端 怎么没有这些东东配置的" |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" |
|
|
|
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" |
|
|
@ -1419,18 +1567,11 @@ show_config_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" |
|
|
|
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
if [[ $obfs ]]; then |
|
|
|
|
|
|
|
echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
if [[ $v2ray_transport_opt -ge 9 && $is_blocked_ad ]]; then |
|
|
|
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]] && [[ $is_blocked_ad ]]; then |
|
|
|
echo " 备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
echo " 备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
echo |
|
|
|
echo |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 ]]; then |
|
|
|
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then |
|
|
|
echo " 备注: 动态端口已启用..." |
|
|
|
echo " 备注: 动态端口已启用..." |
|
|
|
echo |
|
|
|
echo |
|
|
|
elif [[ $is_blocked_ad ]]; then |
|
|
|
elif [[ $is_blocked_ad ]]; then |
|
|
@ -1454,11 +1595,15 @@ show_config_info() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接" |
|
|
|
echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接" |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
|
|
|
echo -e " 温馨提示: 使用${cyan} v2ray ssqr ${none}即可生成 Shadowsocks 配置信息二维码" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
create_qr_link_ask() { |
|
|
|
create_qr_link_ask() { |
|
|
|
if [[ $shadowsocks ]]; then |
|
|
|
if [[ $shadowsocks && $v2ray_transport_opt != 17 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "是否需要生成$yellow V2Ray 和 Shadowsocks $none配置信息二维码链接 [${magenta}Y/N$none]" |
|
|
|
echo -e "是否需要生成$yellow V2Ray 和 Shadowsocks $none配置信息二维码链接 [${magenta}Y/N$none]" |
|
|
@ -1469,13 +1614,13 @@ create_qr_link_ask() { |
|
|
|
break |
|
|
|
break |
|
|
|
elif [[ $y_n == [Nn] ]]; then |
|
|
|
elif [[ $y_n == [Nn] ]]; then |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
# rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
break |
|
|
|
break |
|
|
|
else |
|
|
|
else |
|
|
|
error |
|
|
|
error |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
else |
|
|
|
elif [[ $v2ray_transport_opt != 17 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
while :; do |
|
|
|
while :; do |
|
|
|
echo -e "是否需要生成$yellow V2Ray 配置信息 $none二维码链接 [${magenta}Y/N$none]" |
|
|
|
echo -e "是否需要生成$yellow V2Ray 配置信息 $none二维码链接 [${magenta}Y/N$none]" |
|
|
@ -1486,7 +1631,7 @@ create_qr_link_ask() { |
|
|
|
break |
|
|
|
break |
|
|
|
elif [[ $y_n == [Nn] ]]; then |
|
|
|
elif [[ $y_n == [Nn] ]]; then |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
# rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
break |
|
|
|
break |
|
|
|
else |
|
|
|
else |
|
|
|
error |
|
|
|
error |
|
|
@ -1500,49 +1645,23 @@ get_qr_link() { |
|
|
|
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" |
|
|
|
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
case $v2ray_transport_opt in |
|
|
|
|
|
|
|
[1-4] | 9 | 10 | 11) |
|
|
|
|
|
|
|
local ios_qr=true |
|
|
|
|
|
|
|
local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
|
|
|
cat /etc/v2ray/shadowray_qr.txt | qrencode -s 50 -o /tmp/233blog_shadowray_qr.png |
|
|
|
|
|
|
|
local link3=$(curl -s --upload-file /tmp/233blog_shadowray_qr.png "https://transfer.sh/${random3}_233blog_v2ray.png") |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $1 ]]; then |
|
|
|
if [[ $1 ]]; then |
|
|
|
|
|
|
|
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
|
|
|
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
|
|
|
|
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png") |
|
|
|
local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64)#233blog_ss_${ip}" |
|
|
|
local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64)#233blog_ss_${ip}" |
|
|
|
echo "${ss}" >/tmp/233blog_shadowsocks.txt |
|
|
|
echo "${ss}" >/tmp/233blog_shadowsocks.txt |
|
|
|
cat /tmp/233blog_shadowsocks.txt | qrencode -s 50 -o /tmp/233blog_shadowsocks.png |
|
|
|
cat /tmp/233blog_shadowsocks.txt | qrencode -s 50 -o /tmp/233blog_shadowsocks.png |
|
|
|
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
|
|
|
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
|
|
|
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png") |
|
|
|
|
|
|
|
local link2=$(curl -s --upload-file /tmp/233blog_shadowsocks.png "https://transfer.sh/${random2}_233blog_shadowsocks.png") |
|
|
|
local link2=$(curl -s --upload-file /tmp/233blog_shadowsocks.png "https://transfer.sh/${random2}_233blog_shadowsocks.png") |
|
|
|
if [[ $link1 && $link2 ]]; then |
|
|
|
if [[ $link1 && $link2 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "---------- V2Ray 二维码链接 -------------" |
|
|
|
echo "---------- V2Ray 二维码链接 -------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 适用于 V2RayNG / Kitsunebi = $cyan${link1}$none" |
|
|
|
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
if [[ $ios_qr && $link3 ]]; then |
|
|
|
|
|
|
|
echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 233 (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == 4 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
|
|
|
if [[ $ws_path ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${ws_path}$none" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
elif [[ $ios_qr ]]; then |
|
|
|
|
|
|
|
echo -e "$red 生成适用于 Pepi / ShadowRay 的二维码链接 出错.... $none 请尝试使用${cyan} v2ray qr ${none}重新生成" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo -e "$red 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay...$none" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "---------- Shadowsocks 二维码链接 -------------" |
|
|
|
echo "---------- Shadowsocks 二维码链接 -------------" |
|
|
@ -1571,34 +1690,19 @@ get_qr_link() { |
|
|
|
rm -rf /tmp/233blog_shadowsocks.png |
|
|
|
rm -rf /tmp/233blog_shadowsocks.png |
|
|
|
rm -rf /tmp/233blog_shadowsocks.txt |
|
|
|
rm -rf /tmp/233blog_shadowsocks.txt |
|
|
|
else |
|
|
|
else |
|
|
|
|
|
|
|
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
|
|
|
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png") |
|
|
|
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png") |
|
|
|
|
|
|
|
|
|
|
|
if [[ $link1 ]]; then |
|
|
|
if [[ $link1 ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "---------- V2Ray 二维码链接 -------------" |
|
|
|
echo "---------- V2Ray 二维码链接 -------------" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$yellow 适用于 V2RayNG / Kitsunebi = $cyan${link1}$none" |
|
|
|
|
|
|
|
|
|
|
|
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
if [[ $ios_qr && $link3 ]]; then |
|
|
|
|
|
|
|
echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 233 (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
|
|
|
if [[ $v2ray_transport_opt == 4 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
|
|
|
if [[ $ws_path ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${ws_path}$none" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
elif [[ $ios_qr ]]; then |
|
|
|
|
|
|
|
echo -e "$red 生成适用于 Pepi / ShadowRay 的二维码链接 出错.... $none 请尝试使用${cyan} v2ray qr ${none}重新生成" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo -e "$red 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay...$none" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo "----------------------------------------------------------------" |
|
|
@ -1615,15 +1719,13 @@ get_qr_link() { |
|
|
|
echo |
|
|
|
echo |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
rm -rf /tmp/233blog_v2ray.png |
|
|
|
rm -rf /tmp/233blog_v2ray.png |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
rm -rf /etc/v2ray/vmess.txt |
|
|
|
rm -rf /etc/v2ray/vmess.txt |
|
|
|
if [[ $ios_qr ]]; then |
|
|
|
|
|
|
|
rm -rf /tmp/233blog_shadowray_qr.png |
|
|
|
|
|
|
|
rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
install() { |
|
|
|
install() { |
|
|
|
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then |
|
|
|
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
@ -1730,11 +1832,11 @@ uninstall() { |
|
|
|
del_port $ssport |
|
|
|
del_port $ssport |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport == "4" ]]; then |
|
|
|
if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then |
|
|
|
del_port "80" |
|
|
|
del_port "80" |
|
|
|
del_port "443" |
|
|
|
del_port "443" |
|
|
|
del_port $v2ray_port |
|
|
|
del_port $v2ray_port |
|
|
|
elif [[ $v2ray_transport -ge 9 ]]; then |
|
|
|
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then |
|
|
|
del_port $v2ray_port |
|
|
|
del_port $v2ray_port |
|
|
|
del_port "multiport" |
|
|
|
del_port "multiport" |
|
|
|
else |
|
|
|
else |
|
|
@ -1788,11 +1890,11 @@ uninstall() { |
|
|
|
del_port $ssport |
|
|
|
del_port $ssport |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport == "4" ]]; then |
|
|
|
if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then |
|
|
|
del_port "80" |
|
|
|
del_port "80" |
|
|
|
del_port "443" |
|
|
|
del_port "443" |
|
|
|
del_port $v2ray_port |
|
|
|
del_port $v2ray_port |
|
|
|
elif [[ $v2ray_transport -ge 9 ]]; then |
|
|
|
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then |
|
|
|
del_port $v2ray_port |
|
|
|
del_port $v2ray_port |
|
|
|
del_port "multiport" |
|
|
|
del_port "multiport" |
|
|
|
else |
|
|
|
else |
|
|
|