fix(脚本): 修复当vps不支持IPv6时检查IP异常报错、修复个性化重新安装无法正常识别IP的问题

pull/785/head
mack-a 2023-09-04 17:11:47 +08:00
parent 840f6d2793
commit e473454339
1 changed files with 3 additions and 3 deletions

View File

@ -503,7 +503,7 @@ getPublicIP() {
if [[ -n "$1" ]]; then
type=$1
fi
if [[ -n "${currentHost}" && -n "${currentRealityServerNames}" && "${currentRealityServerNames}" == "${currentHost}" ]]; then
if [[ -n "${currentHost}" && -n "${currentRealityServerNames}" && "${currentRealityServerNames}" == "${currentHost}" && -z "$1" ]]; then
echo "${currentHost}"
else
local currentIP=
@ -1040,7 +1040,7 @@ checkDNSIP() {
echoContent green " ---> 尝试检查域名 IPv6 地址"
dnsIP=$(dig @2606:4700:4700::1111 +time=1 aaaa +short "${domain}")
type=6
if [[ -z "${dnsIP}" ]]; then
if echo "${dnsIP}" | grep -q "network unreachable" || [[ -z "${dnsIP}" ]]; then
echoContent red " ---> 无法通过DNS获取域名IPv6地址退出安装"
exit 0
fi
@ -7891,7 +7891,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者mack-a"
echoContent green "当前版本v2.10.15"
echoContent green "当前版本v2.10.16"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus