From eb971268faea8e9b6014ec7fa0a2f56755343146 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:53:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BA=AFIPv6=E6=9C=BA=E5=99=A8=E8=AE=A2=E9=98=85=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 23d6f19..dcc802c 100644 --- a/install.sh +++ b/install.sh @@ -7579,6 +7579,7 @@ installSubscribe() { local nginxSubscribeSSL= local serverName= local SSLType= + local listenIPv6= if [[ "${coreInstallType}" == "2" || "${selectCoreType}" == "2" ]] && [[ -z "${subscribePort}" ]]; then @@ -7605,7 +7606,6 @@ installSubscribe() { echoContent yellow " ---> 退出安装" exit fi - # ipv6 listen [::]:${result[-1]}; else local subscribeServerName= if [[ -n "${currentHost}" ]]; then @@ -7618,11 +7618,13 @@ installSubscribe() { serverName="server_name ${subscribeServerName};" nginxSubscribeSSL="ssl_certificate /etc/v2ray-agent/tls/${subscribeServerName}.crt;ssl_certificate_key /etc/v2ray-agent/tls/${subscribeServerName}.key;" fi - + if [[ -n "$(curl -s -6 http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | cut -d "=" -f 2)" ]]; then + listenIPv6="listen [::]:${result[-1]};" + fi if echo "${nginxVersion}" | grep -q "1.25" && [[ $(echo "${nginxVersion}" | awk -F "[.]" '{print $3}') -gt 0 ]]; then - nginxSubscribeListen="listen ${result[-1]} ${SSLType} so_keepalive=on;http2 on;" + nginxSubscribeListen="listen ${result[-1]} ${SSLType} so_keepalive=on;http2 on;${listenIPv6}" else - nginxSubscribeListen="listen ${result[-1]} ${SSLType} http2 so_keepalive=on;" + nginxSubscribeListen="listen ${result[-1]} ${SSLType} http2 so_keepalive=on;${listenIPv6}" fi cat <${nginxConfigPath}subscribe.conf @@ -8698,7 +8700,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v3.2.2" + echoContent green "当前版本:v3.2.3" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus