feat(脚本): 修改warp全局分流失败问题、添加删除默认nginx配置防止占用80端口

master
mack-a 2023-06-08 11:32:40 +08:00
parent 4390c5c2cf
commit 345db6aa20
1 changed files with 14 additions and 7 deletions

View File

@ -1130,6 +1130,15 @@ initTLSNginxConfig() {
# handleNginx start # handleNginx start
} }
# 删除nginx默认的配置
removeNginxDefaultConf() {
if [[ -f ${nginxConfigPath}default.conf ]]; then
if [[ "$(grep -c "server_name" <${nginxConfigPath}default.conf)" == "1" ]] && [[ "$(grep -c "server_name localhost;" <${nginxConfigPath}default.conf)" == "1" ]]; then
echoContent green " ---> 删除Nginx默认配置"
rm -rf ${nginxConfigPath}default.conf
fi
fi
}
# 修改nginx重定向配置 # 修改nginx重定向配置
updateRedirectNginxConf() { updateRedirectNginxConf() {
local redirectDomain= local redirectDomain=
@ -1465,6 +1474,7 @@ customPortFunction() {
echoContent yellow "\n ---> 端口: ${port}" echoContent yellow "\n ---> 端口: ${port}"
if [[ -z "${btDomain}" ]]; then if [[ -z "${btDomain}" ]]; then
checkDNSIP "${domain}" checkDNSIP "${domain}"
removeNginxDefaultConf
checkPortOpen "${port}" "${domain}" checkPortOpen "${port}" "${domain}"
fi fi
else else
@ -2357,7 +2367,7 @@ handleXray() {
echoContent green " ---> Xray启动成功" echoContent green " ---> Xray启动成功"
else else
echoContent red "Xray启动失败" echoContent red "Xray启动失败"
echoContent red "请手动执行【/etc/v2ray-agent/xray/xray -confdir /etc/v2ray-agent/xray/conf】,查看错误日志" echoContent red "请手动执行以下的命令后【/etc/v2ray-agent/xray/xray -confdir /etc/v2ray-agent/xray/conf】将错误日志进行反馈"
exit 0 exit 0
fi fi
elif [[ "$1" == "stop" ]]; then elif [[ "$1" == "stop" ]]; then
@ -5432,9 +5442,7 @@ EOF
exit 0 exit 0
fi fi
elif elif [[ "${warpStatus}" == "4" ]]; then
[[ "${warpStatus}" == "4" ]]
then
${removeType} cloudflare-warp >/dev/null 2>&1 ${removeType} cloudflare-warp >/dev/null 2>&1
@ -5551,7 +5559,7 @@ warpRoutingReg() {
"settings": { "settings": {
"secretKey": "${secretKeyWarpReg}", "secretKey": "${secretKeyWarpReg}",
"address": [ "address": [
${address} "${address}"
], ],
"peers": [ "peers": [
{ {
@ -5950,7 +5958,6 @@ EOF
fi fi
done < <(echo "${domainList}" | tr ',' '\n') done < <(echo "${domainList}" | tr ',' '\n')
if [[ -f "${configPath}09_routing.json" ]]; then if [[ -f "${configPath}09_routing.json" ]]; then
unInstallRouting dokodemoDoor-80 inboundTag unInstallRouting dokodemoDoor-80 inboundTag
unInstallRouting dokodemoDoor-443 inboundTag unInstallRouting dokodemoDoor-443 inboundTag
@ -7388,7 +7395,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.9.12" echoContent green "当前版本v2.9.13"
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