mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 修复xray-core核心无法安装VLESSWS问题,增加添加账号、移除账号、添加CDN等操作后自动更新订阅,修改SplitHTTP直连与CDN兼容问题
parent
f4287dfc08
commit
d119785aad
36
install.sh
36
install.sh
|
@ -4213,7 +4213,7 @@ EOF
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
elif [[ -z "$3" ]]; then
|
elif [[ -z "$3" ]]; then
|
||||||
rm /etc/v2ray-agent/xray/conf/03_VLESS_WS_inbounds.json >/dev/null 2>&1
|
rm /etc/v2ray-agent/xray/conf/12_VLESS_SplitHTTP_inbounds.json >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
# trojan_grpc
|
# trojan_grpc
|
||||||
if echo "${selectCustomInstallType}" | grep -q ",2," || [[ "$1" == "all" ]]; then
|
if echo "${selectCustomInstallType}" | grep -q ",2," || [[ "$1" == "all" ]]; then
|
||||||
|
@ -4998,13 +4998,16 @@ EOF
|
||||||
elif [[ "${type}" == "vlessSplitHTTP" ]]; then
|
elif [[ "${type}" == "vlessSplitHTTP" ]]; then
|
||||||
|
|
||||||
echoContent yellow " ---> 通用格式(VLESS+SplitHTTP+TLS)"
|
echoContent yellow " ---> 通用格式(VLESS+SplitHTTP+TLS)"
|
||||||
echoContent green " vless://${id}@${add}:${port}?encryption=none&security=tls&type=splithttp&host=${currentHost}&alpn=h3&sni=${currentHost}&fp=chrome&path=${path}#${email}\n"
|
echoContent green " vless://${id}@${add}:${port}?encryption=none&security=tls&type=splithttp&host=${currentHost}&alpn=h3,h2,http/1.1&sni=${currentHost}&fp=chrome&path=${path}#${email}\n"
|
||||||
|
|
||||||
echoContent yellow " ---> 格式化明文(VLESS+WS+TLS)"
|
echoContent yellow " ---> 格式化明文(VLESS+WS+TLS)"
|
||||||
echoContent green " 协议类型:VLESS,地址:${add},伪装域名/SNI:${currentHost},端口:${port},client-fingerprint: chrome,用户ID:${id},安全:tls,传输方式:splithttp,alpn:h3,路径:${path},账户名:${email}\n"
|
echoContent green " 协议类型:VLESS,地址:${add},伪装域名/SNI:${currentHost},端口:${port},client-fingerprint: chrome,用户ID:${id},安全:tls,传输方式:splithttp,alpn:h3,h2,http/1.1,路径:${path},账户名:${email}\n"
|
||||||
|
|
||||||
|
cat <<EOF >>"/etc/v2ray-agent/subscribe_local/default/${user}"
|
||||||
|
vless://${id}@${add}:${port}?encryption=none&security=tls&type=splithttp&host=${currentHost}&sni=${currentHost}&alpn=h3,h2,http/1.1&fp=chrome&path=${path}#${email}
|
||||||
|
EOF
|
||||||
echoContent yellow " ---> 二维码 VLESS(VLESS+SplitHTTP+TLS)"
|
echoContent yellow " ---> 二维码 VLESS(VLESS+SplitHTTP+TLS)"
|
||||||
echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${id}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dtls%26type%3Dsplithttp%26host%3D${currentHost}%26fp%3Dchrome%26sni%3D${currentHost}%26alpn%3Dh3%26path%3D${path}%23${email}"
|
echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${id}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dtls%26type%3Dsplithttp%26host%3D${currentHost}%26fp%3Dchrome%26sni%3D${currentHost}%26alpn%3Dh3%2Ch2%2Chttp/1.1%26path%3D${path}%23${email}"
|
||||||
elif [[ "${type}" == "vlessgrpc" ]]; then
|
elif [[ "${type}" == "vlessgrpc" ]]; then
|
||||||
|
|
||||||
echoContent yellow " ---> 通用格式(VLESS+gRPC+TLS)"
|
echoContent yellow " ---> 通用格式(VLESS+gRPC+TLS)"
|
||||||
|
@ -5941,7 +5944,8 @@ manageCDN() {
|
||||||
if [[ -n "${setCDNDomain}" ]]; then
|
if [[ -n "${setCDNDomain}" ]]; then
|
||||||
echo >/etc/v2ray-agent/cdn
|
echo >/etc/v2ray-agent/cdn
|
||||||
echo "${setCDNDomain}" >"/etc/v2ray-agent/cdn"
|
echo "${setCDNDomain}" >"/etc/v2ray-agent/cdn"
|
||||||
echoContent green " ---> 修改CDN成功,重新查看用户管理或者订阅后生成新的节点内容"
|
echoContent green " ---> 修改CDN成功"
|
||||||
|
subscribe false false
|
||||||
else
|
else
|
||||||
echoContent red " ---> 不可以为空,请重新输入"
|
echoContent red " ---> 不可以为空,请重新输入"
|
||||||
manageCDN 1
|
manageCDN 1
|
||||||
|
@ -6182,6 +6186,7 @@ addUser() {
|
||||||
done
|
done
|
||||||
reloadCore
|
reloadCore
|
||||||
echoContent green " ---> 添加完成"
|
echoContent green " ---> 添加完成"
|
||||||
|
subscribe false
|
||||||
manageAccount 1
|
manageAccount 1
|
||||||
}
|
}
|
||||||
# 移除用户
|
# 移除用户
|
||||||
|
@ -6281,6 +6286,7 @@ removeUser() {
|
||||||
fi
|
fi
|
||||||
reloadCore
|
reloadCore
|
||||||
fi
|
fi
|
||||||
|
subscribe false
|
||||||
manageAccount 1
|
manageAccount 1
|
||||||
}
|
}
|
||||||
# 更新脚本
|
# 更新脚本
|
||||||
|
@ -8933,23 +8939,30 @@ subscribe() {
|
||||||
installSubscribe
|
installSubscribe
|
||||||
|
|
||||||
readNginxSubscribe
|
readNginxSubscribe
|
||||||
|
local renewSalt=$1
|
||||||
|
local showStatus=$2
|
||||||
if [[ "${coreInstallType}" == "1" || "${coreInstallType}" == "2" ]]; then
|
if [[ "${coreInstallType}" == "1" || "${coreInstallType}" == "2" ]]; then
|
||||||
|
|
||||||
echoContent skyBlue "-------------------------备注---------------------------------"
|
echoContent skyBlue "-------------------------备注---------------------------------"
|
||||||
echoContent yellow "# 查看订阅会重新生成本地账号的订阅"
|
echoContent yellow "# 查看订阅会重新生成本地账号的订阅"
|
||||||
echoContent yellow "# 添加账号或者修改账号需要重新查看订阅才会重新生成对外访问的订阅内容"
|
# echoContent yellow "# 添加账号或者修改账号需要重新查看订阅才会重新生成对外访问的订阅内容"
|
||||||
echoContent red "# 需要手动输入md5加密的salt值,如果不了解使用随机即可"
|
echoContent red "# 需要手动输入md5加密的salt值,如果不了解使用随机即可"
|
||||||
echoContent yellow "# 不影响已添加的远程订阅的内容\n"
|
echoContent yellow "# 不影响已添加的远程订阅的内容\n"
|
||||||
|
|
||||||
if [[ -f "/etc/v2ray-agent/subscribe_local/subscribeSalt" && -n $(cat "/etc/v2ray-agent/subscribe_local/subscribeSalt") ]]; then
|
if [[ -f "/etc/v2ray-agent/subscribe_local/subscribeSalt" && -n $(cat "/etc/v2ray-agent/subscribe_local/subscribeSalt") ]]; then
|
||||||
|
if [[ -z "${renewSalt}" ]]; then
|
||||||
read -r -p "读取到上次安装设置的Salt,是否使用上次生成的Salt ?[y/n]:" historySaltStatus
|
read -r -p "读取到上次安装设置的Salt,是否使用上次生成的Salt ?[y/n]:" historySaltStatus
|
||||||
if [[ "${historySaltStatus}" == "y" ]]; then
|
if [[ "${historySaltStatus}" == "y" ]]; then
|
||||||
subscribeSalt=$(cat /etc/v2ray-agent/subscribe_local/subscribeSalt)
|
subscribeSalt=$(cat /etc/v2ray-agent/subscribe_local/subscribeSalt)
|
||||||
else
|
else
|
||||||
read -r -p "请输入salt值, [回车]使用随机:" subscribeSalt
|
read -r -p "请输入salt值, [回车]使用随机:" subscribeSalt
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
subscribeSalt=$(cat /etc/v2ray-agent/subscribe_local/subscribeSalt)
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
read -r -p "请输入salt值, [回车]使用随机:" subscribeSalt
|
read -r -p "请输入salt值, [回车]使用随机:" subscribeSalt
|
||||||
|
showStatus=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${subscribeSalt}" ]]; then
|
if [[ -z "${subscribeSalt}" ]]; then
|
||||||
|
@ -8967,7 +8980,11 @@ subscribe() {
|
||||||
showAccounts >/dev/null
|
showAccounts >/dev/null
|
||||||
if [[ -n $(ls /etc/v2ray-agent/subscribe_local/default/) ]]; then
|
if [[ -n $(ls /etc/v2ray-agent/subscribe_local/default/) ]]; then
|
||||||
if [[ -f "/etc/v2ray-agent/subscribe_remote/remoteSubscribeUrl" && -n $(cat "/etc/v2ray-agent/subscribe_remote/remoteSubscribeUrl") ]]; then
|
if [[ -f "/etc/v2ray-agent/subscribe_remote/remoteSubscribeUrl" && -n $(cat "/etc/v2ray-agent/subscribe_remote/remoteSubscribeUrl") ]]; then
|
||||||
|
if [[ -z "${renewSalt}" ]]; then
|
||||||
read -r -p "读取到其他订阅,是否更新?[y/n]" updateOtherSubscribeStatus
|
read -r -p "读取到其他订阅,是否更新?[y/n]" updateOtherSubscribeStatus
|
||||||
|
else
|
||||||
|
updateOtherSubscribeStatus=y
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
local subscribePortLocal="${subscribePort}"
|
local subscribePortLocal="${subscribePort}"
|
||||||
find /etc/v2ray-agent/subscribe_local/default/* | while read -r email; do
|
find /etc/v2ray-agent/subscribe_local/default/* | while read -r email; do
|
||||||
|
@ -8996,6 +9013,7 @@ subscribe() {
|
||||||
currentDomain="${currentHost}:${subscribePort}"
|
currentDomain="${currentHost}:${subscribePort}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ -z "${showStatus}" ]]; then
|
||||||
echoContent skyBlue "\n----------默认订阅----------\n"
|
echoContent skyBlue "\n----------默认订阅----------\n"
|
||||||
echoContent green "email:${email}\n"
|
echoContent green "email:${email}\n"
|
||||||
echoContent yellow "url:${subscribeType}://${currentDomain}/s/default/${emailMd5}\n"
|
echoContent yellow "url:${subscribeType}://${currentDomain}/s/default/${emailMd5}\n"
|
||||||
|
@ -9045,6 +9063,10 @@ subscribe() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoContent skyBlue "--------------------------------------------------------------"
|
echoContent skyBlue "--------------------------------------------------------------"
|
||||||
|
else
|
||||||
|
echoContent green " ---> email:${email},订阅已更新,请使用客户端重新拉取"
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -9603,7 +9625,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.16"
|
echoContent green "当前版本:v3.3.17"
|
||||||
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