From 7d672025ec2a83f07926114002c3705a3cd18f69 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:17:47 +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=E6=97=A0=E6=B3=95=E6=90=AD?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?IP=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 73d6106..7d01660 100644 --- a/install.sh +++ b/install.sh @@ -991,9 +991,26 @@ installWarp() { checkDNSIP() { local domain=$1 local dnsIP= - dnsIP=$(dig @1.1.1.1 +short "${domain}") - if [[ -z "${dnsIP}" ]]; then - echoContent red " ---> 无法通过DNS获取IP,请检查解析记录" + dnsIP=$(dig @1.1.1.1 +time=1 +short "${domain}") + if echo "${dnsIP}" | grep -q "timed out" || [[ -z "${dnsIP}" ]]; then + echo + echoContent red " ---> 无法通过DNS获取域名IPv4地址" + echoContent green " ---> 尝试检查域名IPv6地址" + dnsIP=$(dig @2606:4700:4700::1111 +time=1 aaaa +short "${domain}") + if [[ -z "${dnsIP}" ]]; then + echoContent red " ---> 无法通过DNS获取域名IPv6地址,退出安装" + exit 0 + fi + fi + local publicIP= + + publicIP=$(getPublicIP) + + if [[ "${publicIP}" != "${dnsIP}" ]]; then + echoContent red " ---> 域名解析IP与当前服务器IP不一致\n" + echoContent yellow " ---> 请检查域名解析是否生效以及正确" + echoContent green " ---> 当前VPS IP:${publicIP}" + echoContent green " ---> DNS解析 IP:${dnsIP}" exit 0 fi } @@ -7372,7 +7389,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.9.9" + echoContent green "当前版本:v2.9.10" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus