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

pull/384/head
233boy 5 years ago
parent 97d78c8284
commit 344a7becbe
  1. 2
      install.sh
  2. 4
      v2ray.sh

@ -745,7 +745,7 @@ domain_check() {
# $cmd install dnsutils -y # $cmd install dnsutils -y
# fi # fi
# test_domain=$(dig $domain +short) # 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 if [[ $test_domain != $ip ]]; then
echo echo
echo -e "$red 检测域名解析错误....$none" echo -e "$red 检测域名解析错误....$none"

@ -10,7 +10,7 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v3.17" _version="v3.18"
cmd="apt-get" cmd="apt-get"
@ -1763,7 +1763,7 @@ change_proxy_site_config() {
} }
domain_check() { domain_check() {
# test_domain=$(dig $new_domain +short) # test_domain=$(dig $new_domain +short)
test_domain=$(ping $new_domain -c 1 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") test_domain=$(ping $new_domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}")
if [[ $test_domain != $ip ]]; then if [[ $test_domain != $ip ]]; then
echo echo
echo -e "$red 检测域名解析错误....$none" echo -e "$red 检测域名解析错误....$none"

Loading…
Cancel
Save