Added checking to ensure the user does actually supply a DNS entity to diagnose
This commit is contained in:
parent
b9d4a11591
commit
0b30a0e469
23
nscheck.sh
23
nscheck.sh
|
@ -24,6 +24,17 @@ if [ $? -ne 0 -o -z "$DIG_BIN" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Functions
|
||||||
|
function usage () {
|
||||||
|
echo "nscheck 0.1: Bash script to do DNS diagnosis.
|
||||||
|
NOTE: This script will not, at present, function properly for DNS queries which result in more than one record of the same type (ie, DNS round robins)
|
||||||
|
|
||||||
|
Usage: nscheck [-4|-6] DNS.ENTITY
|
||||||
|
nscheck -h: Show this usage.
|
||||||
|
nscheck -4: Use IPv4 [Default].
|
||||||
|
nscheck -6: Use IPv6."
|
||||||
|
}
|
||||||
|
|
||||||
#Internal variables
|
#Internal variables
|
||||||
DIG_RECORD_TYPE="A"
|
DIG_RECORD_TYPE="A"
|
||||||
ZONE=""
|
ZONE=""
|
||||||
|
@ -33,17 +44,15 @@ if [ "$1" == "-6" ]; then
|
||||||
elif [ "$1" == "-4" ]; then
|
elif [ "$1" == "-4" ]; then
|
||||||
ZONE=$2
|
ZONE=$2
|
||||||
elif [ "$1" == "-h" ]; then
|
elif [ "$1" == "-h" ]; then
|
||||||
echo "nscheck 0.1: Bash script to do DNS diagnosis.
|
usage
|
||||||
NOTE: This script will not, at present, function properly for DNS queries which result in more than one record of the same type (ie, DNS round robins)
|
|
||||||
|
|
||||||
Usage: nscheck [-4|-6] DNS.ENTITY
|
|
||||||
nscheck -h: Show this usage.
|
|
||||||
nscheck -4: Use IPv4 [Default].
|
|
||||||
nscheck -6: Use IPv6."
|
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
ZONE=$1
|
ZONE=$1
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$ZONE" ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
DOMAIN=$ZONE
|
DOMAIN=$ZONE
|
||||||
IPS_REPORTED=""
|
IPS_REPORTED=""
|
||||||
NS_REPORTED=""
|
NS_REPORTED=""
|
||||||
|
|
Loading…
Reference in New Issue