fix centos7 check domain ip addr issues

This commit is contained in:
233boy
2018-04-21 12:36:46 +08:00
parent 20ea4247f1
commit b90a9471d7
3 changed files with 5 additions and 5 deletions

View File

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