Update Install.sh

This commit is contained in:
TinrLin 2023-09-05 20:51:35 +08:00 committed by GitHub
parent 3eed1e21d4
commit 4d7e623ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -978,6 +978,11 @@ function get_domain() {
resolved_ipv4=$(dig +short A "$domain" 2>/dev/null)
resolved_ipv6=$(dig +short AAAA "$domain" 2>/dev/null)
echo "输入的域名:$domain"
echo "本地IPv4地址$local_ip_v4"
echo "本地IPv6地址$local_ip_v6"
echo "解析的IPv4地址$resolved_ipv4"
echo "解析的IPv6地址$resolved_ipv6"
if [[ -z $domain ]]; then
echo -e "${RED}错误:域名不能为空,请重新输入。${NC}"
@ -986,6 +991,7 @@ function get_domain() {
break
else
resolved_ip=$(ping "$domain" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')
echo "解析的IP地址ping$resolved_ip"
if [[ ("$resolved_ipv4" == "$local_ip_v4" && ! -z "$resolved_ipv4") || ("$resolved_ipv6" == "$local_ip_v6" && ! -z "$resolved_ipv6") ]]; then
break
else