feat(脚本): 修复sing-box日志选项设置错误问题、修改tuic,hysteria2 server为IP展示、移除tuic,hysteria2选项中的sing-box核心管理并移动到16.core核心管理、修复v2rayN socks5端口设置问题

pull/813/head
mack-a 2023-10-25 00:53:56 +08:00
parent ac180a99d1
commit 96d674ccce
1 changed files with 31 additions and 18 deletions

View File

@ -359,6 +359,7 @@ readInstallType() {
if [[ -d "/etc/v2ray-agent/sing-box" && -f "/etc/v2ray-agent/sing-box/sing-box" ]]; then if [[ -d "/etc/v2ray-agent/sing-box" && -f "/etc/v2ray-agent/sing-box/sing-box" ]]; then
if [[ -d "/etc/v2ray-agent/sing-box/conf" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config/tuic.json" || -f "/etc/v2ray-agent/sing-box/conf/config/hysteria2.json" ]]; then if [[ -d "/etc/v2ray-agent/sing-box/conf" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config/tuic.json" || -f "/etc/v2ray-agent/sing-box/conf/config/hysteria2.json" ]]; then
# coreInstallType=3
singBoxConfigPath=/etc/v2ray-agent/sing-box/conf/ singBoxConfigPath=/etc/v2ray-agent/sing-box/conf/
fi fi
fi fi
@ -704,7 +705,7 @@ showInstallStatus() {
echoContent yellow "\n核心: Xray-core[未运行]" echoContent yellow "\n核心: Xray-core[未运行]"
fi fi
elif [[ "${coreInstallType}" == 2 || "${coreInstallType}" == 3 ]]; then elif [[ "${coreInstallType}" == 2 ]]; then
if [[ -n $(pgrep -f "v2ray/v2ray") ]]; then if [[ -n $(pgrep -f "v2ray/v2ray") ]]; then
echoContent yellow "\n核心: v2ray-core[运行中]" echoContent yellow "\n核心: v2ray-core[运行中]"
else else
@ -750,12 +751,18 @@ showInstallStatus() {
if echo ${currentInstallProtocolType} | grep -q 5; then if echo ${currentInstallProtocolType} | grep -q 5; then
echoContent yellow "VLESS+gRPC[TLS] \c" echoContent yellow "VLESS+gRPC[TLS] \c"
fi fi
if echo ${currentInstallProtocolType} | grep -q 6; then
echoContent yellow "Hysteria2 \c"
fi
if echo ${currentInstallProtocolType} | grep -q 7; then if echo ${currentInstallProtocolType} | grep -q 7; then
echoContent yellow "VLESS+Reality+Vision \c" echoContent yellow "VLESS+Reality+Vision \c"
fi fi
if echo ${currentInstallProtocolType} | grep -q 8; then if echo ${currentInstallProtocolType} | grep -q 8; then
echoContent yellow "VLESS+Reality+gRPC \c" echoContent yellow "VLESS+Reality+gRPC \c"
fi fi
if echo ${currentInstallProtocolType} | grep -q 9; then
echoContent yellow "Tuic \c"
fi
fi fi
} }
@ -1773,8 +1780,6 @@ handleNginx() {
if grep -q "journalctl -xe" </etc/v2ray-agent/nginx_error.log; then if grep -q "journalctl -xe" </etc/v2ray-agent/nginx_error.log; then
updateSELinuxHTTPPortT updateSELinuxHTTPPortT
fi fi
# exit 0
else else
echoContent green " ---> Nginx启动成功" echoContent green " ---> Nginx启动成功"
fi fi
@ -4349,7 +4354,7 @@ EOF
hysteria2://${id}@${currentHost}:${hysteriaPort}?peer=${currentHost}&insecure=0&sni=${currentHost}&alpn=h3#${email} hysteria2://${id}@${currentHost}:${hysteriaPort}?peer=${currentHost}&insecure=0&sni=${currentHost}&alpn=h3#${email}
EOF EOF
echoContent yellow " ---> v2rayN(hysteria+TLS)" echoContent yellow " ---> v2rayN(hysteria+TLS)"
echo "{\"server\": \"${currentHost}:${hysteriaPort}\",\"socks5\": { \"listen\": \"127.0.0.1:10808\", \"timeout\": 300},\"auth\":\"${id}\",\"tls\":{\"sni\":\"${currentHost}\"}}" | jq echo "{\"server\": \"$(getPublicIP 4):${hysteriaPort}\",\"socks5\": { \"listen\": \"127.0.0.1:7798\", \"timeout\": 300},\"auth\":\"${id}\",\"tls\":{\"sni\":\"${currentHost}\"}}" | jq
cat <<EOF >>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}" cat <<EOF >>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}"
- name: "${email}" - name: "${email}"
@ -4432,7 +4437,7 @@ EOF
tuic://${id}@${currentHost}:${tuicPort}?peer=${currentHost}&congestion_control=${tuicAlgorithm}&password=${id}&insecure=0&sni=${currentHost}&alpn=h3#${email} tuic://${id}@${currentHost}:${tuicPort}?peer=${currentHost}&congestion_control=${tuicAlgorithm}&password=${id}&insecure=0&sni=${currentHost}&alpn=h3#${email}
EOF EOF
echoContent yellow " ---> v2rayN(Tuic+TLS)" echoContent yellow " ---> v2rayN(Tuic+TLS)"
echo "{\"relay\": {\"server\": \"${currentHost}:${tuicPort}\",\"uuid\": \"${id}\",\"password\": \"${id}\",\"ip\": \"$(getPublicIP)\",\"congestion_control\": \"${tuicAlgorithm}\",\"alpn\": [\"h3\"]},\"local\": {\"server\": \"127.0.0.1:7798\"},\"log_level\": \"warn\"}" | jq echo "{\"relay\": {\"server\": \"${currentHost}:${tuicPort}\",\"uuid\": \"${id}\",\"password\": \"${id}\",\"ip\": \"$(getPublicIP 4)\",\"congestion_control\": \"${tuicAlgorithm}\",\"alpn\": [\"h3\"]},\"local\": {\"server\": \"127.0.0.1:7798\"},\"log_level\": \"warn\"}" | jq
cat <<EOF >>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}" cat <<EOF >>"/etc/v2ray-agent/subscribe_local/clashMeta/${user}"
- name: "${email}" - name: "${email}"
@ -4903,7 +4908,6 @@ unInstall() {
if [[ -z $(pgrep -f "nginx") ]]; then if [[ -z $(pgrep -f "nginx") ]]; then
echoContent green " ---> 停止Nginx成功" echoContent green " ---> 停止Nginx成功"
fi fi
if [[ "${coreInstallType}" == "1" ]]; then if [[ "${coreInstallType}" == "1" ]]; then
handleXray stop handleXray stop
rm -rf /etc/systemd/system/xray.service rm -rf /etc/systemd/system/xray.service
@ -4943,6 +4947,7 @@ unInstall() {
rm -rf /etc/v2ray-agent rm -rf /etc/v2ray-agent
rm -rf ${nginxConfigPath}alone.conf rm -rf ${nginxConfigPath}alone.conf
rm -rf ${nginxConfigPath}checkPortOpen.conf >/dev/null 2>&1
if [[ -d "${nginxStaticPath}" && -f "${nginxStaticPath}/check" ]]; then if [[ -d "${nginxStaticPath}" && -f "${nginxStaticPath}/check" ]]; then
rm -rf "${nginxStaticPath}" rm -rf "${nginxStaticPath}"
@ -7075,11 +7080,20 @@ coreVersionManageMenu() {
menu menu
exit 0 exit 0
fi fi
if [[ "${coreInstallType}" == "1" ]]; then echoContent skyBlue "\n功能 1/1 : 请选择核心"
echoContent red "\n=============================================================="
echoContent yellow "1.Xray-core"
echoContent yellow "2.v2ray-core"
echoContent yellow "3.sing-box"
echoContent red "=============================================================="
read -r -p "请输入:" selectCore
if [[ "${selectCore}" == "1" ]]; then
xrayVersionManageMenu 1 xrayVersionManageMenu 1
elif [[ "${coreInstallType}" == "2" ]]; then elif [[ "${coreInstallType}" == "2" ]]; then
v2rayCoreVersion= echoContent red " ---> 暂停维护"
v2rayVersionManageMenu 1 elif [[ "${selectCore}" == "3" ]]; then
singBoxVersionManageMenu 1
fi fi
} }
# 定时任务检查 # 定时任务检查
@ -7985,7 +7999,7 @@ manageHysteria() {
echoContent yellow " 依赖第三方sing-box\n" echoContent yellow " 依赖第三方sing-box\n"
echoContent yellow "1.重新安装" echoContent yellow "1.重新安装"
echoContent yellow "2.卸载" echoContent yellow "2.卸载"
echoContent yellow "3.sing-box core管理" # echoContent yellow "3.sing-box core管理"
hysteria2Status=true hysteria2Status=true
else else
echoContent yellow "1.安装" echoContent yellow "1.安装"
@ -7998,8 +8012,8 @@ manageHysteria() {
singBoxHysteria2Install singBoxHysteria2Install
elif [[ "${installHysteria2Status}" == "2" && "${hysteria2Status}" == "true" ]]; then elif [[ "${installHysteria2Status}" == "2" && "${hysteria2Status}" == "true" ]]; then
unInstallSingBox hysteria2 unInstallSingBox hysteria2
elif [[ "${installHysteria2Status}" == "3" && "${hysteria2Status}" == "true" ]]; then # elif [[ "${installHysteria2Status}" == "3" && "${hysteria2Status}" == "true" ]]; then
singBoxVersionManageMenu 1 # singBoxVersionManageMenu 1
fi fi
} }
@ -8012,7 +8026,7 @@ manageTuic() {
echoContent yellow " 依赖第三方sing-box\n" echoContent yellow " 依赖第三方sing-box\n"
echoContent yellow "1.重新安装" echoContent yellow "1.重新安装"
echoContent yellow "2.卸载" echoContent yellow "2.卸载"
echoContent yellow "3.sing-box core管理" # echoContent yellow "3.sing-box core管理"
tuicStatus=true tuicStatus=true
else else
echoContent yellow "1.安装" echoContent yellow "1.安装"
@ -8025,8 +8039,8 @@ manageTuic() {
singBoxTuicInstall singBoxTuicInstall
elif [[ "${installTuicStatus}" == "2" && "${tuicStatus}" == "true" ]]; then elif [[ "${installTuicStatus}" == "2" && "${tuicStatus}" == "true" ]]; then
unInstallSingBox tuic unInstallSingBox tuic
elif [[ "${installTuicStatus}" == "3" && "${tuicStatus}" == "true" ]]; then # elif [[ "${installTuicStatus}" == "3" && "${tuicStatus}" == "true" ]]; then
singBoxVersionManageMenu 1 # singBoxVersionManageMenu 1
fi fi
} }
# sing-box log日志 # sing-box log日志
@ -8089,7 +8103,7 @@ singBoxVersionManageMenu() {
echoContent yellow "4.重启 sing-box" echoContent yellow "4.重启 sing-box"
echoContent yellow "==============================================================" echoContent yellow "=============================================================="
local logStatus= local logStatus=
if [[ -n "${singBoxConfigPath}" && "$(jq -r .log.disabled ${singBoxConfigPath}config.json)" == "true" ]]; then if [[ -n "${singBoxConfigPath}" && -f "${singBoxConfigPath}config/log.json" && "$(jq -r .log.disabled ${singBoxConfigPath}config/log.json)" == "false" ]]; then
echoContent yellow "5.关闭日志" echoContent yellow "5.关闭日志"
logStatus=true logStatus=true
else else
@ -8151,7 +8165,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.11.6" echoContent green "当前版本v2.11.7"
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
@ -8161,7 +8175,6 @@ menu() {
echoContent green "推广请联系TG@mackaff\n" echoContent green "推广请联系TG@mackaff\n"
echoContent green "VPS选购攻略https://www.v2ray-agent.com/archives/1679975663984" echoContent green "VPS选购攻略https://www.v2ray-agent.com/archives/1679975663984"
echoContent green "年付10美金低价VPS AS4837https://www.v2ray-agent.com/archives/racknerdtao-can-zheng-li-nian-fu-10mei-yuan" echoContent green "年付10美金低价VPS AS4837https://www.v2ray-agent.com/archives/racknerdtao-can-zheng-li-nian-fu-10mei-yuan"
echoContent green "搬瓦工传家宝套餐 49.99刀 gia/软银https://bandwagonhost.com/aff.php?aff=64917&pid=94"
echoContent red "==============================================================" echoContent red "=============================================================="
if [[ -n "${coreInstallType}" ]]; then if [[ -n "${coreInstallType}" ]]; then
echoContent yellow "1.重新安装" echoContent yellow "1.重新安装"