fix(脚本): 修改搭建时检测IPv6配置

pull/1073/head
mack-a 2024-07-22 11:08:04 +08:00
parent 50098b2b99
commit a6fb0f1898
1 changed files with 7 additions and 2 deletions

View File

@ -1312,10 +1312,15 @@ checkPortOpen() {
handleNginx stop
# 初始化nginx配置
touch ${nginxConfigPath}checkPortOpen.conf
local listenIPv6PortConfig=
if [[ -n $(curl -s -6 http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | cut -d "=" -f 2) ]]; then
listenIPv6PortConfig="listen [::]:${port};"
fi
cat <<EOF >${nginxConfigPath}checkPortOpen.conf
server {
listen ${port};
listen [::]:${port};
${listenIPv6PortConfig}
server_name ${domain};
location /checkPort {
return 200 'fjkvymb6len';
@ -9443,7 +9448,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者mack-a"
echoContent green "当前版本v3.3.11"
echoContent green "当前版本v3.3.12"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus