mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 修复reality安装后正常使用但是重新更换订阅无法使用的问题、修复httpupgrade无法添加CDN的问题、增加tuic读取上次配置、增加读取reailty dest端口
parent
acbf6a3d2e
commit
f12554c0c5
133
install.sh
133
install.sh
|
@ -489,8 +489,6 @@ readInstallProtocolType() {
|
||||||
xrayVLESSRealityServerName=$(jq -r .inbounds[0].streamSettings.realitySettings.serverNames[0] "${row}.json")
|
xrayVLESSRealityServerName=$(jq -r .inbounds[0].streamSettings.realitySettings.serverNames[0] "${row}.json")
|
||||||
realityServerName=${xrayVLESSRealityServerName}
|
realityServerName=${xrayVLESSRealityServerName}
|
||||||
xrayVLESSRealityPort=$(jq -r .inbounds[0].port "${row}.json")
|
xrayVLESSRealityPort=$(jq -r .inbounds[0].port "${row}.json")
|
||||||
# xrayVLESSRealityPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json")
|
|
||||||
# xrayVLESSRealityPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json")
|
|
||||||
currentRealityPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json")
|
currentRealityPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json")
|
||||||
currentRealityPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json")
|
currentRealityPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json")
|
||||||
|
|
||||||
|
@ -498,6 +496,8 @@ readInstallProtocolType() {
|
||||||
frontingTypeReality=07_VLESS_vision_reality_inbounds
|
frontingTypeReality=07_VLESS_vision_reality_inbounds
|
||||||
singBoxVLESSRealityVisionPort=$(jq -r .inbounds[0].listen_port "${row}.json")
|
singBoxVLESSRealityVisionPort=$(jq -r .inbounds[0].listen_port "${row}.json")
|
||||||
singBoxVLESSRealityVisionServerName=$(jq -r .inbounds[0].tls.server_name "${row}.json")
|
singBoxVLESSRealityVisionServerName=$(jq -r .inbounds[0].tls.server_name "${row}.json")
|
||||||
|
realityDomainPort=$(jq -r .inbounds[0].tls.reality.handshake.server_port "${row}.json")
|
||||||
|
|
||||||
realityServerName=${singBoxVLESSRealityVisionServerName}
|
realityServerName=${singBoxVLESSRealityVisionServerName}
|
||||||
if [[ -f "${configPath}reality_key" ]]; then
|
if [[ -f "${configPath}reality_key" ]]; then
|
||||||
singBoxVLESSRealityPublicKey=$(grep "publicKey" <"${configPath}reality_key" | awk -F "[:]" '{print $2}')
|
singBoxVLESSRealityPublicKey=$(grep "publicKey" <"${configPath}reality_key" | awk -F "[:]" '{print $2}')
|
||||||
|
@ -2897,8 +2897,9 @@ handleSingBox() {
|
||||||
echoContent green " ---> sing-box启动成功"
|
echoContent green " ---> sing-box启动成功"
|
||||||
else
|
else
|
||||||
echoContent red "sing-box启动失败"
|
echoContent red "sing-box启动失败"
|
||||||
echoContent red "请手动执行【/etc/v2ray-agent/sing-box/sing-box merge config.json -C /etc/v2ray-agent/sing-box/conf/config/ -D /etc/v2ray-agent/sing-box/conf/】,查看错误日志"
|
echoContent yellow "请手动执行【 /etc/v2ray-agent/sing-box/sing-box merge config.json -C /etc/v2ray-agent/sing-box/conf/config/ -D /etc/v2ray-agent/sing-box/conf/ 】,查看错误日志"
|
||||||
echoContent red "如上面命令没有错误,请手动执行【/etc/v2ray-agent/sing-box/sing-box run -c /etc/v2ray-agent/sing-box/conf/config.json】,查看错误日志"
|
echo
|
||||||
|
echoContent yellow "如上面命令没有错误,请手动执行【 /etc/v2ray-agent/sing-box/sing-box run -c /etc/v2ray-agent/sing-box/conf/config.json 】,查看错误日志"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
elif [[ "$1" == "stop" ]]; then
|
elif [[ "$1" == "stop" ]]; then
|
||||||
|
@ -3412,28 +3413,42 @@ initTuicPort() {
|
||||||
|
|
||||||
# 初始化tuic的协议
|
# 初始化tuic的协议
|
||||||
initTuicProtocol() {
|
initTuicProtocol() {
|
||||||
echoContent skyBlue "\n请选择算法类型"
|
if [[ -n "${tuicAlgorithm}" && -z "${lastInstallationConfig}" ]]; then
|
||||||
echoContent red "=============================================================="
|
read -r -p "读取到上次使用的端口,是否使用 ?[y/n]:" historyTuicAlgorithm
|
||||||
echoContent yellow "1.bbr(默认)"
|
if [[ "${historyTuicAlgorithm}" != "y" ]]; then
|
||||||
echoContent yellow "2.cubic"
|
tuicAlgorithm=
|
||||||
echoContent yellow "3.new_reno"
|
else
|
||||||
echoContent red "=============================================================="
|
echoContent yellow "\n ---> 算法: ${tuicAlgorithm}\n"
|
||||||
read -r -p "请选择:" selectTuicAlgorithm
|
fi
|
||||||
case ${selectTuicAlgorithm} in
|
elif [[ -n "${tuicAlgorithm}" && -n "${lastInstallationConfig}" ]]; then
|
||||||
1)
|
echoContent yellow "\n ---> 算法: ${tuicAlgorithm}\n"
|
||||||
tuicAlgorithm="bbr"
|
fi
|
||||||
;;
|
|
||||||
2)
|
if [[ -z "${tuicAlgorithm}" ]]; then
|
||||||
tuicAlgorithm="cubic"
|
|
||||||
;;
|
echoContent skyBlue "\n请选择算法类型"
|
||||||
3)
|
echoContent red "=============================================================="
|
||||||
tuicAlgorithm="new_reno"
|
echoContent yellow "1.bbr(默认)"
|
||||||
;;
|
echoContent yellow "2.cubic"
|
||||||
*)
|
echoContent yellow "3.new_reno"
|
||||||
tuicAlgorithm="bbr"
|
echoContent red "=============================================================="
|
||||||
;;
|
read -r -p "请选择:" selectTuicAlgorithm
|
||||||
esac
|
case ${selectTuicAlgorithm} in
|
||||||
echoContent yellow "\n ---> 算法: ${tuicAlgorithm}\n"
|
1)
|
||||||
|
tuicAlgorithm="bbr"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
tuicAlgorithm="cubic"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
tuicAlgorithm="new_reno"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tuicAlgorithm="bbr"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echoContent yellow "\n ---> 算法: ${tuicAlgorithm}\n"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 初始化tuic配置
|
# 初始化tuic配置
|
||||||
|
@ -4465,13 +4480,18 @@ EOF
|
||||||
rm /etc/v2ray-agent/xray/conf/08_VLESS_vision_gRPC_inbounds.json >/dev/null 2>&1
|
rm /etc/v2ray-agent/xray/conf/08_VLESS_vision_gRPC_inbounds.json >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
installSniffing
|
installSniffing
|
||||||
removeXrayOutbound IPv4_out
|
if [[ -z "$3" ]]; then
|
||||||
removeXrayOutbound IPv6_out
|
removeXrayOutbound wireguard_out_IPv4_route
|
||||||
removeXrayOutbound socks5_outbound
|
removeXrayOutbound wireguard_out_IPv6_route
|
||||||
removeXrayOutbound blackhole_out
|
removeXrayOutbound wireguard_outbound
|
||||||
removeXrayOutbound wireguard_out_IPv6
|
removeXrayOutbound IPv4_out
|
||||||
removeXrayOutbound wireguard_out_IPv4
|
removeXrayOutbound IPv6_out
|
||||||
addXrayOutbound z_direct_outbound
|
removeXrayOutbound socks5_outbound
|
||||||
|
removeXrayOutbound blackhole_out
|
||||||
|
removeXrayOutbound wireguard_out_IPv6
|
||||||
|
removeXrayOutbound wireguard_out_IPv4
|
||||||
|
addXrayOutbound z_direct_outbound
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 初始化TCP Brutal
|
# 初始化TCP Brutal
|
||||||
|
@ -4905,17 +4925,23 @@ EOF
|
||||||
elif [[ -z "$3" ]]; then
|
elif [[ -z "$3" ]]; then
|
||||||
rm /etc/v2ray-agent/sing-box/conf/config/11_VMess_HTTPUpgrade_inbounds.json >/dev/null 2>&1
|
rm /etc/v2ray-agent/sing-box/conf/config/11_VMess_HTTPUpgrade_inbounds.json >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
removeSingBoxConfig wireguard_out_IPv4
|
if [[ -z "$3" ]]; then
|
||||||
removeSingBoxConfig wireguard_out_IPv6
|
removeSingBoxConfig wireguard_out_IPv4
|
||||||
removeSingBoxConfig IPv4_out
|
removeSingBoxConfig wireguard_out_IPv6
|
||||||
removeSingBoxConfig IPv6_out
|
removeSingBoxConfig wireguard_out_IPv4_route
|
||||||
removeSingBoxConfig IPv6_route
|
removeSingBoxConfig wireguard_out_IPv6_route
|
||||||
removeSingBoxConfig block
|
removeSingBoxConfig wireguard_outbound
|
||||||
removeSingBoxConfig cn_block_outbound
|
|
||||||
removeSingBoxConfig cn_block_route
|
removeSingBoxConfig IPv4_out
|
||||||
removeSingBoxConfig 01_direct_outbound
|
removeSingBoxConfig IPv6_out
|
||||||
removeSingBoxConfig block_domain_outbound
|
removeSingBoxConfig IPv6_route
|
||||||
removeSingBoxConfig dns
|
removeSingBoxConfig block
|
||||||
|
removeSingBoxConfig cn_block_outbound
|
||||||
|
removeSingBoxConfig cn_block_route
|
||||||
|
removeSingBoxConfig 01_direct_outbound
|
||||||
|
removeSingBoxConfig block_domain_outbound
|
||||||
|
removeSingBoxConfig dns
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
# 初始化 sing-box订阅配置
|
# 初始化 sing-box订阅配置
|
||||||
initSubscribeLocalConfig() {
|
initSubscribeLocalConfig() {
|
||||||
|
@ -5945,7 +5971,7 @@ manageCDN() {
|
||||||
echoContent skyBlue "\n进度 $1/1 : CDN节点管理"
|
echoContent skyBlue "\n进度 $1/1 : CDN节点管理"
|
||||||
local setCDNDomain=
|
local setCDNDomain=
|
||||||
|
|
||||||
if echo "${currentInstallProtocolType}" | grep -qE ",1,|,2,|,3,|,5,"; then
|
if echo "${currentInstallProtocolType}" | grep -qE ",1,|,2,|,3,|,5,|,11,"; then
|
||||||
echoContent red "=============================================================="
|
echoContent red "=============================================================="
|
||||||
echoContent yellow "# 注意事项"
|
echoContent yellow "# 注意事项"
|
||||||
echoContent yellow "\n教程地址:"
|
echoContent yellow "\n教程地址:"
|
||||||
|
@ -5995,7 +6021,7 @@ manageCDN() {
|
||||||
else
|
else
|
||||||
echoContent yellow "\n教程地址:"
|
echoContent yellow "\n教程地址:"
|
||||||
echoContent skyBlue "https://www.v2ray-agent.com/archives/cloudflarezi-xuan-ip\n"
|
echoContent skyBlue "https://www.v2ray-agent.com/archives/cloudflarezi-xuan-ip\n"
|
||||||
echoContent red " ---> 未检测到可以使用的协议,仅支持ws或者grpc相关的协议"
|
echoContent red " ---> 未检测到可以使用的协议,仅支持ws、grpc、HTTPUpgrade相关的协议"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# 自定义uuid
|
# 自定义uuid
|
||||||
|
@ -8069,6 +8095,7 @@ customSingBoxInstall() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${selectCustomInstallType//,/}" =~ ^[0-9]+$ ]]; then
|
if [[ "${selectCustomInstallType//,/}" =~ ^[0-9]+$ ]]; then
|
||||||
|
unInstallSubscribe
|
||||||
readLastInstallationConfig
|
readLastInstallationConfig
|
||||||
totalProgress=9
|
totalProgress=9
|
||||||
installTools 1
|
installTools 1
|
||||||
|
@ -8090,7 +8117,6 @@ customSingBoxInstall() {
|
||||||
handleNginx start
|
handleNginx start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 8
|
checkGFWStatue 8
|
||||||
unInstallSubscribe
|
|
||||||
showAccounts 9
|
showAccounts 9
|
||||||
else
|
else
|
||||||
echoContent red " ---> 输入不合法"
|
echoContent red " ---> 输入不合法"
|
||||||
|
@ -8191,7 +8217,6 @@ customXrayInstall() {
|
||||||
handleXray start
|
handleXray start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 11
|
checkGFWStatue 11
|
||||||
unInstallSubscribe
|
|
||||||
showAccounts 12
|
showAccounts 12
|
||||||
else
|
else
|
||||||
echoContent red " ---> 输入不合法"
|
echoContent red " ---> 输入不合法"
|
||||||
|
@ -8271,7 +8296,6 @@ xrayCoreInstall() {
|
||||||
handleNginx start
|
handleNginx start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 11
|
checkGFWStatue 11
|
||||||
unInstallSubscribe
|
|
||||||
showAccounts 12
|
showAccounts 12
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9295,12 +9319,11 @@ initRealityClientServersName() {
|
||||||
read -r -p "读取到上次安装设置的Reality域名,是否使用?[y/n]:" realityServerNameStatus
|
read -r -p "读取到上次安装设置的Reality域名,是否使用?[y/n]:" realityServerNameStatus
|
||||||
if [[ "${realityServerNameStatus}" != "y" ]]; then
|
if [[ "${realityServerNameStatus}" != "y" ]]; then
|
||||||
realityServerName=
|
realityServerName=
|
||||||
|
realityDomainPort=
|
||||||
fi
|
fi
|
||||||
elif [[ -z "${lastInstallationConfig}" ]]; then
|
elif [[ -n "${realityServerName}" && -z "${lastInstallationConfig}" ]]; then
|
||||||
realityServerName=
|
realityServerName=
|
||||||
fi
|
realityDomainPort=
|
||||||
if [[ -n "${realityServerName}" ]] && [[ "${realityServerName}" != "${domain}" ]]; then
|
|
||||||
realityDomainPort=443
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${realityServerName}" ]]; then
|
if [[ -z "${realityServerName}" ]]; then
|
||||||
|
@ -9456,7 +9479,7 @@ xrayCoreRealityInstall() {
|
||||||
sleep 2
|
sleep 2
|
||||||
# 启动
|
# 启动
|
||||||
handleXray start
|
handleXray start
|
||||||
unInstallSubscribe
|
# unInstallSubscribe
|
||||||
# 生成账号
|
# 生成账号
|
||||||
showAccounts 8
|
showAccounts 8
|
||||||
}
|
}
|
||||||
|
@ -9687,7 +9710,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
echoContent green "作者:mack-a"
|
||||||
echoContent green "当前版本:v3.3.19"
|
echoContent green "当前版本:v3.3.20"
|
||||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue