fix domain check issues

This commit is contained in:
233boy
2018-03-05 09:48:21 +08:00
parent 4f9a0f34f9
commit a72086ac24
2 changed files with 10 additions and 10 deletions

View File

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