From f0cd6ebfc0503d076d313b82e4be7030a75a696a Mon Sep 17 00:00:00 2001 From: jiuqi9997 <60207794+jiuqi9997@users.noreply.github.com> Date: Mon, 22 Jan 2024 01:40:47 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9F=9F=E5=90=8D=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 24a9be5..cde1e45 100644 --- a/install.sh +++ b/install.sh @@ -172,7 +172,7 @@ function nginx_install() { mkdir -p /etc/nginx/conf.d >/dev/null 2>&1 } function dependency_install() { - ${INS} wget lsof tar + ${INS} wget lsof tar bind9-dnsutils judge "安装 wget lsof tar" if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then @@ -248,7 +248,8 @@ function basic_optimization() { function domain_check() { read -rp "请输入你的域名信息(eg: www.wulabing.com):" domain - domain_ip=$(curl -sm8 ipget.net/?ip="${domain}") + domain_ipv4="$(dig +short "${domain}" a)" + domain_ipv6="$(dig +short "${domain}" aaaa)" print_ok "正在获取 IP 地址信息,请耐心等待" wgcfv4_status=$(curl -s4m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2) wgcfv6_status=$(curl -s6m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2) @@ -268,10 +269,10 @@ function domain_check() { echo -e "本机公网 IPv4 地址: ${local_ipv4}" echo -e "本机公网 IPv6 地址: ${local_ipv6}" sleep 2 - if [[ ${domain_ip} == "${local_ipv4}" ]]; then + if [[ ${domain_ipv4} == "${local_ipv4}" ]]; then print_ok "域名通过 DNS 解析的 IP 地址与 本机 IPv4 地址匹配" sleep 2 - elif [[ ${domain_ip} == "${local_ipv6}" ]]; then + elif [[ ${domain_ipv6} == "${local_ipv6}" ]]; then print_ok "域名通过 DNS 解析的 IP 地址与 本机 IPv6 地址匹配" sleep 2 else