diff --git a/Install.sh b/Install.sh index a192a27..49f09ff 100644 --- a/Install.sh +++ b/Install.sh @@ -1315,11 +1315,13 @@ function prompt_fake_domain() { function prompt_and_check_bound_domain() { read -p "请输入域名(用于自动申请证书): " input_domain - local_ip=$(hostname -I | awk '{print $1}') + local_ip_v4=$(hostname -I | awk '{print $1}') + local_ip_v6=$(ip -o -6 addr show scope global | awk '{print $4; exit}') + resolved_ipv4=$(dig +short A "$input_domain") resolved_ipv6=$(dig +short AAAA "$input_domain") - if [[ "$resolved_ipv4" != "$local_ip" && "$resolved_ipv6" != "$local_ip" ]]; then + if [[ "$resolved_ipv4" != "$local_ip_v4" && "$resolved_ipv6" != "$local_ip_v6" ]]; then echo "错误:域名未绑定本机IP,请重新输入。" prompt_and_check_bound_domain else