feat(脚本): 修改singbox日志无法查看问题、修改无证书订阅的判断、修改nginx异常未启动问题

pull/883/head^2
mack-a 2023-12-20 14:34:36 +08:00
parent bc45844443
commit 2220d82a4b
1 changed files with 18 additions and 24 deletions

View File

@ -383,6 +383,15 @@ readInstallType() {
readInstallProtocolType() { readInstallProtocolType() {
currentInstallProtocolType= currentInstallProtocolType=
frontingType= frontingType=
singBoxVLESSVisionPort=
singBoxHysteria2Port=
frontingTypeReality=
singBoxVLESSRealityVisionPort=
singBoxVLESSRealityVisionServerName=
singBoxVLESSRealityGRPCPort=
singBoxVLESSRealityGRPCServerName=
singBoxTuicPort=
singBoxHysteria2Port=
while read -r row; do while read -r row; do
if echo "${row}" | grep -q VLESS_TCP_inbounds; then if echo "${row}" | grep -q VLESS_TCP_inbounds; then
@ -439,7 +448,7 @@ readInstallProtocolType() {
if echo "${row}" | grep -q tuic_inbounds; then if echo "${row}" | grep -q tuic_inbounds; then
currentInstallProtocolType=${currentInstallProtocolType}'9' currentInstallProtocolType=${currentInstallProtocolType}'9'
if [[ "${coreInstallType}" == "2" ]]; then if [[ "${coreInstallType}" == "2" ]]; then
frontingType=tuic_inbounds frontingType=09_tuic_inbounds
singBoxTuicPort=$(jq .inbounds[0].listen_port "${row}.json") singBoxTuicPort=$(jq .inbounds[0].listen_port "${row}.json")
fi fi
@ -596,22 +605,19 @@ checkFirewalldAllowPort() {
# 读取Tuic配置 # 读取Tuic配置
readSingBoxConfig() { readSingBoxConfig() {
tuicPort=
hysteriaPort=
if [[ -n "${singBoxConfigPath}" ]]; then if [[ -n "${singBoxConfigPath}" ]]; then
if [[ -f "${singBoxConfigPath}09_tuic_inbounds.json" ]]; then if [[ -f "${singBoxConfigPath}09_tuic_inbounds.json" ]]; then
tuicPort=$(jq -r '.inbounds[0].listen_port' "${singBoxConfigPath}09_tuic_inbounds.json") tuicPort=$(jq -r '.inbounds[0].listen_port' "${singBoxConfigPath}09_tuic_inbounds.json")
tuicAlgorithm=$(jq -r '.inbounds[0].congestion_control' "${singBoxConfigPath}09_tuic_inbounds.json") tuicAlgorithm=$(jq -r '.inbounds[0].congestion_control' "${singBoxConfigPath}09_tuic_inbounds.json")
else
tuicPort=
fi fi
if [[ -f "${singBoxConfigPath}06_hysteria2_inbounds.json" ]]; then if [[ -f "${singBoxConfigPath}06_hysteria2_inbounds.json" ]]; then
hysteriaPort=$(jq -r '.inbounds[0].listen_port' "${singBoxConfigPath}06_hysteria2_inbounds.json") hysteriaPort=$(jq -r '.inbounds[0].listen_port' "${singBoxConfigPath}06_hysteria2_inbounds.json")
hysteria2ClientUploadSpeed=$(jq -r '.inbounds[0].down_mbps' "${singBoxConfigPath}06_hysteria2_inbounds.json") hysteria2ClientUploadSpeed=$(jq -r '.inbounds[0].down_mbps' "${singBoxConfigPath}06_hysteria2_inbounds.json")
hysteria2ClientDownloadSpeed=$(jq -r '.inbounds[0].up_mbps' "${singBoxConfigPath}06_hysteria2_inbounds.json") hysteria2ClientDownloadSpeed=$(jq -r '.inbounds[0].up_mbps' "${singBoxConfigPath}06_hysteria2_inbounds.json")
else
hysteriaPort=
fi fi
fi fi
} }
@ -2590,8 +2596,8 @@ initXrayClients() {
local users= local users=
users=[] users=[]
while read -r user; do while read -r user; do
uuid=$(echo "${user}" | jq -r .id) uuid=$(echo "${user}" | jq -r .id//.uuid)
email=$(echo "${user}" | jq -r .email | awk -F "[-]" '{print $1}') email=$(echo "${user}" | jq -r .email//.name | awk -F "[-]" '{print $1}')
currentUser= currentUser=
if echo "${type}" | grep -q "0"; then if echo "${type}" | grep -q "0"; then
currentUser="{\"id\":\"${uuid}\",\"flow\":\"xtls-rprx-vision\",\"email\":\"${email}-VLESS_TCP/TLS_Vision\"}" currentUser="{\"id\":\"${uuid}\",\"flow\":\"xtls-rprx-vision\",\"email\":\"${email}-VLESS_TCP/TLS_Vision\"}"
@ -4447,16 +4453,14 @@ showAccounts() {
readInstallType readInstallType
readInstallProtocolType readInstallProtocolType
readConfigHostPathUUID readConfigHostPathUUID
readSingBoxConfig
readXrayCoreRealityConfig readXrayCoreRealityConfig
readSingBoxConfig
echo echo
echoContent skyBlue "\n进度 $1/${totalProgress} : 账号" echoContent skyBlue "\n进度 $1/${totalProgress} : 账号"
local show
# VLESS TCP # VLESS TCP
if echo ${currentInstallProtocolType} | grep -q 0; then if echo ${currentInstallProtocolType} | grep -q 0; then
show=1
echoContent skyBlue "============================= VLESS TCP TLS_Vision [推荐] ==============================\n" echoContent skyBlue "============================= VLESS TCP TLS_Vision [推荐] ==============================\n"
jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}02_VLESS_TCP_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}02_VLESS_TCP_inbounds.json | jq -c '.[]' | while read -r user; do
@ -4583,7 +4587,6 @@ showAccounts() {
# VLESS reality vision # VLESS reality vision
if echo ${currentInstallProtocolType} | grep -q 7; then if echo ${currentInstallProtocolType} | grep -q 7; then
show=1
echoContent skyBlue "============================= VLESS reality_vision [推荐] ==============================\n" echoContent skyBlue "============================= VLESS reality_vision [推荐] ==============================\n"
jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}07_VLESS_vision_reality_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}07_VLESS_vision_reality_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
@ -4596,7 +4599,6 @@ showAccounts() {
fi fi
# VLESS reality gRPC # VLESS reality gRPC
if echo ${currentInstallProtocolType} | grep -q 8; then if echo ${currentInstallProtocolType} | grep -q 8; then
show=1
echoContent skyBlue "============================== VLESS reality_gRPC [推荐] ===============================\n" echoContent skyBlue "============================== VLESS reality_gRPC [推荐] ===============================\n"
jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}08_VLESS_vision_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do jq .inbounds[0].settings.clients//.inbounds[0].users ${configPath}08_VLESS_vision_gRPC_inbounds.json | jq -c '.[]' | while read -r user; do
local email= local email=
@ -4621,10 +4623,6 @@ showAccounts() {
done done
fi fi
if [[ -z ${show} ]]; then
echoContent red " ---> 未安装"
fi
} }
# 移除nginx302配置 # 移除nginx302配置
removeNginx302() { removeNginx302() {
@ -7007,14 +7005,10 @@ singBoxInstall() {
cleanUp xrayDel cleanUp xrayDel
installCronTLS 8 installCronTLS 8
# updateRedirectNginxConf
handleSingBox stop handleSingBox stop
handleNginx stop
sleep 2 sleep 2
handleSingBox start handleSingBox start
# handleNginx start
# 生成账号 # 生成账号
# checkGFWStatue 12 # checkGFWStatue 12
showAccounts 9 showAccounts 9
@ -7164,7 +7158,7 @@ installSubscribe() {
mapfile -t result < <(initSingBoxPort "${subscribePort}") mapfile -t result < <(initSingBoxPort "${subscribePort}")
if (! echo "${selectCustomInstallType}" | grep -q -E "0|1|2|3|4|5|69" || ! echo "${currentInstallProtocolType}" | grep -q -E "0|1|2|3|4|5|69") && [[ "${selectInstallType}" == "2" || "${coreInstallType}" == "2" ]]; then if ( ([[ -n "${selectCustomInstallType}" ]] && ! echo "${selectCustomInstallType}" | grep -q -E "0|1|2|3|4|5|6|9") || ([[ -n "${currentInstallProtocolType}" ]] && ! echo "${currentInstallProtocolType}" | grep -q -E "0|1|2|3|4|5|6|9")) && [[ "${selectInstallType}" == "2" || "${coreInstallType}" == "2" ]]; then
echoContent green "未发现tls证书使用无加密订阅可能被运营商拦截。请注意风险" echoContent green "未发现tls证书使用无加密订阅可能被运营商拦截。请注意风险"
read -r -p "是否使用[y/n]" addNginxSubscribeStatus read -r -p "是否使用[y/n]" addNginxSubscribeStatus
if [[ "${addNginxSubscribeStatus}" != "y" ]]; then if [[ "${addNginxSubscribeStatus}" != "y" ]]; then
@ -8169,7 +8163,7 @@ singBoxLog() {
"log": { "log": {
"disabled": $1, "disabled": $1,
"level": "debug", "level": "debug",
"output": "/etc/v2ray-agent/sing-box/box.log", "output": "/etc/v2ray-agent/sing-box/conf/box.log",
"timestamp": true "timestamp": true
} }
} }
@ -8262,7 +8256,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.1.10-beta" echoContent green "当前版本v3.1.11-beta"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus