only check ipv4 addr, fix #367, fix #370

This commit is contained in:
233boy
2019-10-26 22:25:39 +08:00
parent 97d78c8284
commit 344a7becbe
2 changed files with 3 additions and 3 deletions

View File

@@ -745,7 +745,7 @@ domain_check() {
# $cmd install dnsutils -y
# fi
# test_domain=$(dig $domain +short)
test_domain=$(ping $domain -c 1 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}")
test_domain=$(ping $domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}")
if [[ $test_domain != $ip ]]; then
echo
echo -e "$red 检测域名解析错误....$none"