|
|
|
@ -10,7 +10,7 @@ none='\e[0m' |
|
|
|
|
# Root |
|
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
|
|
|
|
|
|
_version="v2.25" |
|
|
|
|
_version="v2.30" |
|
|
|
|
|
|
|
|
|
cmd="apt-get" |
|
|
|
|
|
|
|
|
@ -48,8 +48,8 @@ if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup & |
|
|
|
|
|
|
|
|
|
. $backup |
|
|
|
|
v2ray_ver=$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2) |
|
|
|
|
if [[ ! $path ]]; then |
|
|
|
|
. /etc/v2ray/233boy/v2ray/tools/support_h2.sh |
|
|
|
|
if [[ ! $username ]]; then |
|
|
|
|
. /etc/v2ray/233boy/v2ray/tools/support_socks.sh |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
elif [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f /etc/v2ray/233blog_v2ray_backup.txt && -d /etc/v2ray/233boy/v2ray ]]; then |
|
|
|
@ -112,6 +112,7 @@ transport=( |
|
|
|
|
mKCP_srtp_dynamicPort |
|
|
|
|
mKCP_wechat-video_dynamicPort |
|
|
|
|
HTTP/2 |
|
|
|
|
Socks5 |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
ciphers=( |
|
|
|
@ -134,43 +135,32 @@ get_transport_args() { |
|
|
|
|
case $v2ray_transport in |
|
|
|
|
1 | 9) |
|
|
|
|
net="tcp" |
|
|
|
|
# network="tcp" |
|
|
|
|
# obfs="none" |
|
|
|
|
;; |
|
|
|
|
2 | 10) |
|
|
|
|
net="tcp" |
|
|
|
|
# network="tcp" |
|
|
|
|
header="http" |
|
|
|
|
host="www.baidu.com" |
|
|
|
|
# obfs="http" |
|
|
|
|
;; |
|
|
|
|
3 | 4 | 11) |
|
|
|
|
net="ws" |
|
|
|
|
# network="ws (WebSocket)" |
|
|
|
|
# obfs="websocket" |
|
|
|
|
;; |
|
|
|
|
5 | 12) |
|
|
|
|
net="kcp" |
|
|
|
|
# network="kcp" |
|
|
|
|
;; |
|
|
|
|
6 | 13) |
|
|
|
|
net="kcp" |
|
|
|
|
# network="kcp" |
|
|
|
|
header="utp" |
|
|
|
|
;; |
|
|
|
|
7 | 14) |
|
|
|
|
net="kcp" |
|
|
|
|
# network="kcp" |
|
|
|
|
header="srtp" |
|
|
|
|
;; |
|
|
|
|
8 | 15) |
|
|
|
|
net="kcp" |
|
|
|
|
# network="kcp" |
|
|
|
|
header="wechat-video" |
|
|
|
|
;; |
|
|
|
|
16) |
|
|
|
|
net="h2" |
|
|
|
|
# local network="h2" |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
} |
|
|
|
@ -215,8 +205,8 @@ create_vmess_URL_config() { |
|
|
|
|
} |
|
|
|
|
view_v2ray_config_info() { |
|
|
|
|
|
|
|
|
|
get_transport_args |
|
|
|
|
|
|
|
|
|
[[ $v2ray_transport != 17 ]] && get_transport_args |
|
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo "---------- V2Ray 配置信息 -------------" |
|
|
|
@ -244,14 +234,25 @@ view_v2ray_config_info() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none" |
|
|
|
|
echo |
|
|
|
|
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
|
# echo |
|
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
|
|
echo |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport == 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 |
|
|
|
|
else |
|
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" |
|
|
|
|
echo |
|
|
|
@ -265,13 +266,6 @@ view_v2ray_config_info() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" |
|
|
|
|
echo |
|
|
|
|
# if [[ $obfs ]]; then |
|
|
|
|
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
|
# echo |
|
|
|
|
# else |
|
|
|
|
# echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay" |
|
|
|
|
# echo |
|
|
|
|
# fi |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then |
|
|
|
|
echo " 备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
@ -775,27 +769,31 @@ disable_shadowsocks() { |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
change_v2ray_config() { |
|
|
|
|
local _menu=( |
|
|
|
|
"修改 V2Ray 端口" |
|
|
|
|
"修改 V2Ray 传输协议" |
|
|
|
|
"修改 V2Ray 动态端口 (如果可以)" |
|
|
|
|
"修改 用户ID ( UUID )" |
|
|
|
|
"修改 TLS 域名 (如果可以)" |
|
|
|
|
"修改 分流的路径 (如果可以)" |
|
|
|
|
"修改 伪装的网址 (如果可以)" |
|
|
|
|
"关闭 网站伪装 和 路径分流 (如果可以)" |
|
|
|
|
"开启 / 关闭 广告拦截" |
|
|
|
|
"修改 Socks5 用户名 (如果可以)" |
|
|
|
|
"修改 Socks5 密码 (如果可以)" |
|
|
|
|
) |
|
|
|
|
while :; do |
|
|
|
|
for ((i = 1; i <= ${#_menu[*]}; i++)); do |
|
|
|
|
if [[ "$i" -le 9 ]]; then |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow $i. $none${_menu[$i - 1]}" |
|
|
|
|
else |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow $i. $none${_menu[$i - 1]}" |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 1. $none修改 V2Ray 端口" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 2. $none修改 V2Ray 传输协议" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 3. $none修改 V2Ray 动态端口 (如果可以)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 4. $none修改 用户ID ( UUID )" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 5. $none修改 TLS 域名 (如果可以)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 6. $none修改 分流的路径 (如果可以)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 7. $none修改 伪装的网址 (如果可以)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 8. $none关闭 网站伪装 和 路径分流 (如果可以)" |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 9. $none开启 / 关闭 广告拦截" |
|
|
|
|
echo |
|
|
|
|
read -p "$(echo -e "请选择 [${magenta}1-9$none]:")" _opt |
|
|
|
|
read -p "$(echo -e "请选择 [${magenta}1-${#_menu[*]}$none]:")" _opt |
|
|
|
|
if [[ -z $_opt ]]; then |
|
|
|
|
error |
|
|
|
|
else |
|
|
|
@ -836,6 +834,19 @@ change_v2ray_config() { |
|
|
|
|
blocked_hosts |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
10) |
|
|
|
|
change_socks_user_config |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
11) |
|
|
|
|
change_socks_pass_config |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
[aA][Ii][aA][Ii] | [Dd][Dd]) |
|
|
|
|
socks_check |
|
|
|
|
custom_uuid |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
[Dd] | [Aa][Ii] | 233 | 233[Bb][Ll][Oo][Gg] | 233[Bb][Ll][Oo][Gg].[Cc][Oo][Mm] | 233[Bb][Oo][Yy] | [Aa][Ll][Tt][Ee][Rr][Ii][Dd]) |
|
|
|
|
change_v2ray_alterId |
|
|
|
|
break |
|
|
|
@ -1002,7 +1013,7 @@ change_v2ray_transport() { |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
;; |
|
|
|
|
[1-9] | 1[0-6]) |
|
|
|
|
[1-9] | 1[0-7]) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" |
|
|
|
@ -1025,31 +1036,7 @@ change_v2ray_transport() { |
|
|
|
|
v2ray_dynamic_port_start |
|
|
|
|
v2ray_dynamic_port_end |
|
|
|
|
pause |
|
|
|
|
if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then |
|
|
|
|
del_port "80" |
|
|
|
|
del_port "443" |
|
|
|
|
if [[ $caddy_installed && $caddy_pid ]]; then |
|
|
|
|
# systemctl stop caddy |
|
|
|
|
do_service stop caddy |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
elif [[ $caddy_installed ]]; then |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
|
# sed -i "41s/true/false/" $backup |
|
|
|
|
backup_config -path |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
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}" |
|
|
|
@ -1058,34 +1045,22 @@ change_v2ray_transport() { |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
elif [[ $v2ray_transport_opt == 17 ]]; then |
|
|
|
|
socks_user_config |
|
|
|
|
socks_pass_config |
|
|
|
|
pause |
|
|
|
|
old_transport |
|
|
|
|
backup_config v2ray_transport username userpass |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
|
username=$new_username |
|
|
|
|
userpass=$new_userpass |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
else |
|
|
|
|
# sed -i "17s/$v2ray_transport/$v2ray_transport_opt/" $backup |
|
|
|
|
old_transport |
|
|
|
|
backup_config v2ray_transport |
|
|
|
|
if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then |
|
|
|
|
del_port "80" |
|
|
|
|
del_port "443" |
|
|
|
|
if [[ $caddy_installed && $caddy_pid ]]; then |
|
|
|
|
# systemctl stop caddy |
|
|
|
|
do_service stop caddy |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
elif [[ $caddy_installed ]]; then |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
|
# sed -i "41s/true/false/" $backup |
|
|
|
|
backup_config -path |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
v2ray_transport=$v2ray_transport_opt |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
@ -1094,6 +1069,79 @@ change_v2ray_transport() { |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
old_transport() { |
|
|
|
|
if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then |
|
|
|
|
del_port "80" |
|
|
|
|
del_port "443" |
|
|
|
|
if [[ $caddy_installed && $caddy_pid ]]; then |
|
|
|
|
do_service stop caddy |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
elif [[ $caddy_installed ]]; then |
|
|
|
|
if [[ $systemd ]]; then |
|
|
|
|
systemctl disable caddy >/dev/null 2>&1 |
|
|
|
|
else |
|
|
|
|
update-rc.d -f caddy remove >/dev/null 2>&1 |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
|
backup_config -path |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then |
|
|
|
|
del_port "multiport" |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
socks_user_config() { |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
read -p "$(echo -e "请输入$yellow用户名$none...(默认用户名: ${cyan}233blog$none)"): " new_username |
|
|
|
|
[ -z "$new_username" ] && new_username="233blog" |
|
|
|
|
case $new_username in |
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
echo |
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 用户名 = $cyan$new_username$none" |
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
echo |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
socks_pass_config() { |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
read -p "$(echo -e "请输入$yellow密码$none...(默认密码: ${cyan}233blog.com$none)"): " new_userpass |
|
|
|
|
[ -z "$new_userpass" ] && new_userpass="233blog.com" |
|
|
|
|
case $new_userpass in |
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
echo |
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 密码 = $cyan$new_userpass$none" |
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
echo |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tls_config() { |
|
|
|
|
while :; do |
|
|
|
@ -2150,6 +2198,148 @@ change_v2ray_alterId() { |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
change_socks_user_config() { |
|
|
|
|
if [[ $v2ray_transport == 17 ]]; then |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
read -p "$(echo -e "请输入$yellow用户名$none...(当前用户名: ${cyan}$username$none)"): " new_username |
|
|
|
|
[ -z "$new_username" ] && error && continue |
|
|
|
|
case $new_username in |
|
|
|
|
$username) |
|
|
|
|
echo |
|
|
|
|
echo -e " 大佬...跟 当前用户名 一毛一样啊...修改个鸡鸡哦 " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
echo |
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 用户名 = $cyan$new_username$none" |
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
backup_config username |
|
|
|
|
username=$new_username |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
else |
|
|
|
|
echo |
|
|
|
|
echo -e "$red 哎呀....不支持修改呢...$none" |
|
|
|
|
echo |
|
|
|
|
echo -e " 必须使用..${cyan} Socks5 $none传输协议才能修改哦" |
|
|
|
|
echo |
|
|
|
|
echo -e " 当前传输协议为: ${cyan}${transport[$v2ray_transport - 1]}${none}" |
|
|
|
|
echo |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
change_socks_pass_config() { |
|
|
|
|
if [[ $v2ray_transport == 17 ]]; then |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
read -p "$(echo -e "请输入$yellow密码$none...(当前密码: ${cyan}$userpass$none)"): " new_userpass |
|
|
|
|
[ -z "$new_userpass" ] && error && continue |
|
|
|
|
case $new_userpass in |
|
|
|
|
$userpass) |
|
|
|
|
echo |
|
|
|
|
echo -e " 大佬...跟 当前密码 一毛一样啊...修改个鸡鸡哦 " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
echo |
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 密码 = $cyan$new_userpass$none" |
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
backup_config userpass |
|
|
|
|
userpass=$new_userpass |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
else |
|
|
|
|
echo |
|
|
|
|
echo -e "$red 哎呀....不支持修改呢...$none" |
|
|
|
|
echo |
|
|
|
|
echo -e " 必须使用..${cyan} Socks5 $none传输协议才能修改哦" |
|
|
|
|
echo |
|
|
|
|
echo -e " 当前传输协议为: ${cyan}${transport[$v2ray_transport - 1]}${none}" |
|
|
|
|
echo |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
socks_check() { |
|
|
|
|
if [[ $v2ray_transport == 17 ]]; then |
|
|
|
|
echo |
|
|
|
|
echo -e " 哎呀...由于你当前使用 Socks5 传输协议...是无法执行此功能的哦.." |
|
|
|
|
echo |
|
|
|
|
echo -e " 如果你想要查看 Socks5 配置信息的话...请使用$cyan v2ray info $none" |
|
|
|
|
echo |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
custom_uuid() { |
|
|
|
|
echo |
|
|
|
|
while :; do |
|
|
|
|
echo -e "请输入$yello自定义的 UUID$none...(${cyan}UUID 格式一定要对!!!$none)" |
|
|
|
|
read -p "$(echo -e "(当前 UUID: ${cyan}${v2ray_id}$none)"): " myuuid |
|
|
|
|
[ -z "$myuuid" ] && error && continue |
|
|
|
|
case $myuuid in |
|
|
|
|
$v2ray_id) |
|
|
|
|
echo |
|
|
|
|
echo -e " 大佬...跟 当前 UUID 一毛一样啊...修改个鸡鸡哦 " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*[/$]* | *\&*) |
|
|
|
|
echo |
|
|
|
|
echo -e " 由于这个脚本太辣鸡了..所以 UUID 不能包含$red / $none或$red $ $none或$red & $none这三个符号.... " |
|
|
|
|
echo |
|
|
|
|
error |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
echo |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow UUID = $cyan$myuuid$none" |
|
|
|
|
echo |
|
|
|
|
echo -e " 如果 UUID 格式不正确.. V2Ray 会跪...使用$cyan v2ray reuuid$none 复活" |
|
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
|
echo |
|
|
|
|
pause |
|
|
|
|
uuid=$myuuid |
|
|
|
|
backup_config uuid |
|
|
|
|
v2ray_id=$uuid |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
break |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
v2ray_service() { |
|
|
|
|
while :; do |
|
|
|
|
echo |
|
|
|
@ -2339,7 +2529,6 @@ get_v2ray_config_link() { |
|
|
|
|
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" |
|
|
|
|
echo |
|
|
|
|
local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
# local link=$(curl -s --upload-file /etc/v2ray/233blog_v2ray.zip "https://transfer.sh/${random}_233blog_v2ray.zip") |
|
|
|
|
local link=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random}_233blog_v2ray.json") |
|
|
|
|
if [[ $link ]]; then |
|
|
|
|
echo |
|
|
|
@ -2347,8 +2536,6 @@ get_v2ray_config_link() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 链接 = $cyan$link$none" |
|
|
|
|
echo |
|
|
|
|
# echo -e "$yellow 解压密码 = ${cyan}233blog.com$none" |
|
|
|
|
# echo |
|
|
|
|
echo -e "$yellow SOCKS 监听端口 = ${cyan}2333${none}" |
|
|
|
|
echo |
|
|
|
|
echo -e "${yellow} HTTP 监听端口 = ${cyan}6666$none" |
|
|
|
@ -2396,8 +2583,6 @@ create_v2ray_config_text() { |
|
|
|
|
echo |
|
|
|
|
echo "TLS (Enable TLS) = 打开" |
|
|
|
|
echo |
|
|
|
|
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
|
# echo |
|
|
|
|
if [[ $is_blocked_ad ]]; then |
|
|
|
|
echo " 备注: 广告拦截已开启.." |
|
|
|
|
echo |
|
|
|
@ -2417,13 +2602,6 @@ create_v2ray_config_text() { |
|
|
|
|
echo |
|
|
|
|
echo "伪装类型 (header type) = ${header}" |
|
|
|
|
echo |
|
|
|
|
# if [[ $obfs ]]; then |
|
|
|
|
# echo -e "请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " |
|
|
|
|
# echo |
|
|
|
|
# else |
|
|
|
|
# echo -e "帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay" |
|
|
|
|
# echo |
|
|
|
|
# fi |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -ge 9 || $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then |
|
|
|
|
echo "备注: 动态端口已启用...广告拦截已开启..." |
|
|
|
@ -2441,6 +2619,7 @@ create_v2ray_config_text() { |
|
|
|
|
echo |
|
|
|
|
} |
|
|
|
|
get_v2ray_config_info_link() { |
|
|
|
|
socks_check |
|
|
|
|
echo |
|
|
|
|
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" |
|
|
|
|
echo |
|
|
|
@ -2468,29 +2647,12 @@ get_v2ray_config_info_link() { |
|
|
|
|
} |
|
|
|
|
get_v2ray_config_qr_link() { |
|
|
|
|
|
|
|
|
|
socks_check |
|
|
|
|
create_vmess_URL_config |
|
|
|
|
|
|
|
|
|
# if [[ $obfs ]]; then |
|
|
|
|
# if [[ $v2ray_transport == 4 ]]; then |
|
|
|
|
# ip_or_domain=$domain |
|
|
|
|
# else |
|
|
|
|
# ip_or_domain=$ip |
|
|
|
|
# fi |
|
|
|
|
# local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${v2ray_id}@${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 |
|
|
|
|
echo |
|
|
|
|
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" |
|
|
|
|
echo |
|
|
|
|
# case $v2ray_transport 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 |
|
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
@ -2502,19 +2664,6 @@ get_v2ray_config_qr_link() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan$link$none" |
|
|
|
|
echo |
|
|
|
|
# if [[ $ios_qr && $link3 ]]; then |
|
|
|
|
# echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none" |
|
|
|
|
# echo |
|
|
|
|
# echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 ${alterId} (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
# if [[ $v2ray_transport == 4 ]]; then |
|
|
|
|
# echo |
|
|
|
|
# echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)" |
|
|
|
|
# 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 " V2Ray 客户端使用教程: https://233blog.com/post/20/" |
|
|
|
|
echo |
|
|
|
@ -2532,12 +2681,9 @@ get_v2ray_config_qr_link() { |
|
|
|
|
rm -rf /tmp/233blog_v2ray.png |
|
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
get_v2ray_vmess_URL_link() { |
|
|
|
|
socks_check |
|
|
|
|
create_vmess_URL_config |
|
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
|
echo |
|
|
|
@ -2987,6 +3133,10 @@ config() { |
|
|
|
|
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 |
|
|
|
|
else |
|
|
|
|
case $v2ray_transport in |
|
|
|
@ -3030,6 +3180,10 @@ config() { |
|
|
|
|
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 |
|
|
|
|
fi |
|
|
|
|
else |
|
|
|
@ -3075,6 +3229,10 @@ config() { |
|
|
|
|
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 |
|
|
|
|
else |
|
|
|
|
case $v2ray_transport in |
|
|
|
@ -3118,6 +3276,10 @@ config() { |
|
|
|
|
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 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
@ -3152,6 +3314,9 @@ 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 |
|
|
|
|
|
|
|
|
|
case $v2ray_transport in |
|
|
|
@ -3223,8 +3388,11 @@ config() { |
|
|
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config |
|
|
|
|
|
|
|
|
|
if [[ $v2ray_transport == 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/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config |
|
|
|
|
fi |
|
|
|
|
if [[ $v2ray_transport -eq 16 ]]; then |
|
|
|
|
sed -i "24s/233blog.com/$domain/" $v2ray_server_config |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
@ -3234,6 +3402,7 @@ config() { |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
|
if [[ $v2ray_transport -eq 4 || $v2ray_transport -eq 16 ]]; then |
|
|
|
|
sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config |
|
|
|
|
if [[ $is_path ]]; then |
|
|
|
@ -3241,8 +3410,9 @@ config() { |
|
|
|
|
else |
|
|
|
|
sed -i "40s/233blog//" $v2ray_client_config |
|
|
|
|
fi |
|
|
|
|
elif [[ $v2ray_transport == 17 ]]; then |
|
|
|
|
sed -i "21s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/233blog/$username/; 26s/233blog.com/$userpass/" $v2ray_client_config |
|
|
|
|
else |
|
|
|
|
[[ -z $ip ]] && get_ip |
|
|
|
|
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
@ -3319,6 +3489,12 @@ backup_config() { |
|
|
|
|
proxy_site) |
|
|
|
|
sed -i "63s#=$proxy_site#=$new_proxy_site#" $backup |
|
|
|
|
;; |
|
|
|
|
username) |
|
|
|
|
sed -i "66s/=$username/=$new_username/" $backup |
|
|
|
|
;; |
|
|
|
|
userpass) |
|
|
|
|
sed -i "69s/=$userpass/=$new_userpass/" $backup |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
|
|
|
|
@ -3332,24 +3508,6 @@ _boom_() { |
|
|
|
|
|
|
|
|
|
create_vmess_URL_config |
|
|
|
|
|
|
|
|
|
# if [[ $obfs ]]; then |
|
|
|
|
# if [[ $v2ray_transport == 4 ]]; then |
|
|
|
|
# ip_or_domain=$domain |
|
|
|
|
# else |
|
|
|
|
# ip_or_domain=$ip |
|
|
|
|
# fi |
|
|
|
|
# local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${v2ray_id}@${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 |
|
|
|
|
# case $v2ray_transport in |
|
|
|
|
# [1-4] | 9 | 10 | 11) |
|
|
|
|
# local ios_qr=true |
|
|
|
|
# local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
# cat /etc/v2ray/shadowray_qr.txt | qrencode -s 50 -o /tmp/233blog_shadowray_qr.png |
|
|
|
|
# local link=$(curl -s --upload-file /tmp/233blog_shadowray_qr.png "https://transfer.sh/${random}_233blog_v2ray.png") |
|
|
|
|
# ;; |
|
|
|
|
# esac |
|
|
|
|
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" |
|
|
|
|
echo $vmess >/etc/v2ray/vmess.txt |
|
|
|
|
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png |
|
|
|
@ -3357,7 +3515,6 @@ _boom_() { |
|
|
|
|
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64) |
|
|
|
|
# local link1=$(curl -s --upload-file /etc/v2ray/233blog_v2ray.zip "https://transfer.sh/${random1}_233blog_v2ray.zip") |
|
|
|
|
local link1=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random1}_233blog_v2ray.json") |
|
|
|
|
local link2=$(curl -s --upload-file /tmp/233blog_v2ray.txt "https://transfer.sh/${random2}_233blog_v2ray.txt") |
|
|
|
|
local link3=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random3}_233blog_v2ray.png") |
|
|
|
@ -3369,8 +3526,6 @@ _boom_() { |
|
|
|
|
echo |
|
|
|
|
echo -e "$yellow V2RayNG v0.4.1+ / Kitsunebi 二维码链接: $cyan$link3$none" |
|
|
|
|
echo |
|
|
|
|
# echo -e "$yellow Pepi / ShadowRay 二维码链接: $cyan$link$none" |
|
|
|
|
# echo |
|
|
|
|
echo "V2Ray 客户端使用教程: https://233blog.com/post/20/" |
|
|
|
|
echo |
|
|
|
|
else |
|
|
|
@ -3380,8 +3535,6 @@ _boom_() { |
|
|
|
|
fi |
|
|
|
|
rm -rf /tmp/233blog_v2ray.txt |
|
|
|
|
rm -rf /etc/v2ray/vmess_qr.json |
|
|
|
|
# rm -rf /etc/v2ray/shadowray_qr.txt |
|
|
|
|
# rm -rf /tmp/233blog_shadowray_qr.png |
|
|
|
|
rm -rf /etc/v2ray/vmess.txt |
|
|
|
|
rm -rf /tmp/233blog_v2ray.png |
|
|
|
|
|
|
|
|
@ -3609,16 +3762,32 @@ un | uninstall) |
|
|
|
|
reinstall) |
|
|
|
|
uninstall_v2ray |
|
|
|
|
if [[ $is_uninstall_v2ray ]]; then |
|
|
|
|
cd; cd - >/dev/null 2>&1 |
|
|
|
|
cd |
|
|
|
|
cd - >/dev/null 2>&1 |
|
|
|
|
bash <(curl -s -L https://233blog.com/v2ray.sh) |
|
|
|
|
fi |
|
|
|
|
;; |
|
|
|
|
233 | 2333 | 233boy | 233blog | 233blog.com) |
|
|
|
|
socks_check |
|
|
|
|
_boom_ |
|
|
|
|
;; |
|
|
|
|
[aA][Ii] | [Dd]) |
|
|
|
|
socks_check |
|
|
|
|
change_v2ray_alterId |
|
|
|
|
;; |
|
|
|
|
[aA][Ii][aA][Ii] | [Dd][Dd]) |
|
|
|
|
socks_check |
|
|
|
|
custom_uuid |
|
|
|
|
;; |
|
|
|
|
reuuid) |
|
|
|
|
socks_check |
|
|
|
|
backup_config uuid |
|
|
|
|
v2ray_id=$uuid |
|
|
|
|
config |
|
|
|
|
clear |
|
|
|
|
view_v2ray_config_info |
|
|
|
|
download_v2ray_config_ask |
|
|
|
|
;; |
|
|
|
|
v | version) |
|
|
|
|
echo |
|
|
|
|
echo -e " 当前 V2Ray 版本: ${green}$v2ray_ver$none / 当前 V2Ray 管理脚本版本: ${cyan}$_version$none" |
|
|
|
|