core: 不重要的更新

This commit is contained in:
bin456789
2024-02-01 01:02:35 +08:00
parent db1b2c92ca
commit d9b53f1bf8
5 changed files with 24 additions and 23 deletions

View File

@ -121,20 +121,18 @@ test_internet() {
echo 'Testing Internet Connection...'
for i in $(seq 5); do
{
if is_need_test_ipv4 && nslookup www.qq.com $ipv4_dns1; then
echo "IPv4 has internet."
ipv4_has_internet=true
fi
if is_need_test_ipv6 && nslookup www.qq.com $ipv6_dns1; then
echo "IPv6 has internet."
ipv6_has_internet=true
fi
if ! is_need_test_ipv4 && ! is_need_test_ipv6; then
break
fi
sleep 1
} >/dev/null 2>&1
if is_need_test_ipv4 && nslookup www.qq.com $ipv4_dns1 2>/dev/null; then
echo "IPv4 has internet."
ipv4_has_internet=true
fi
if is_need_test_ipv6 && nslookup www.qq.com $ipv6_dns1 2>/dev/null; then
echo "IPv6 has internet."
ipv6_has_internet=true
fi
if ! is_need_test_ipv4 && ! is_need_test_ipv6; then
break
fi
sleep 1
done
}