mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-02 14:40:52 +03:00
install_easy: system DNS test first
This commit is contained in:
parent
c066cf03cc
commit
37d2cf5989
@ -913,10 +913,15 @@ pingtest()
|
|||||||
{
|
{
|
||||||
ping -c 1 -W 1 $1 >/dev/null
|
ping -c 1 -W 1 $1 >/dev/null
|
||||||
}
|
}
|
||||||
|
dnstest()
|
||||||
|
{
|
||||||
|
# $1 - dns server. empty for system resolver
|
||||||
|
nslookup w3.org $1 >/dev/null 2>/dev/null
|
||||||
|
}
|
||||||
find_working_public_dns()
|
find_working_public_dns()
|
||||||
{
|
{
|
||||||
for dns in $DNSCHECK_DNS; do
|
for dns in $DNSCHECK_DNS; do
|
||||||
pingtest $dns && nslookup w3.org $dns >/dev/null 2>/dev/null && {
|
pingtest $dns && dnstest $dns && {
|
||||||
PUBDNS=$dns
|
PUBDNS=$dns
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -943,6 +948,13 @@ check_dns()
|
|||||||
echo \* checking DNS
|
echo \* checking DNS
|
||||||
|
|
||||||
[ -f "$DNSCHECK_DIGS" ] && rm -f "$DNSCHECK_DIGS"
|
[ -f "$DNSCHECK_DIGS" ] && rm -f "$DNSCHECK_DIGS"
|
||||||
|
|
||||||
|
dnstest || {
|
||||||
|
echo -- DNS is not working. It's either misconfigured or blocked or you don't have inet access.
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
echo system DNS is working
|
||||||
|
|
||||||
if find_working_public_dns ; then
|
if find_working_public_dns ; then
|
||||||
echo comparing system resolver to public DNS : $PUBDNS
|
echo comparing system resolver to public DNS : $PUBDNS
|
||||||
for dom in $DNSCHECK_DOM; do
|
for dom in $DNSCHECK_DOM; do
|
||||||
|
Loading…
Reference in New Issue
Block a user