Fixed typo in detect_ip_version for ipv6

This commit is contained in:
Eric Renfro 2017-08-20 00:41:01 -04:00
parent 9f27bebf11
commit e013ec9198

View file

@ -15,32 +15,6 @@ trim() {
printf '%s' "$var"
}
detect_ip_version() {
local ip=$1
if valid_ipv4 "$ip"; then
return 4;
elif valid_ipv6 "ip"; then
return 6
else
return 0;
fi
}
valid_ip() {
local ip=$1
local iptype
detect_ip_version "$ip"
iptype=$?
case $iptype in
4) return 0;;
6) return 0;;
*) return 1;;
esac
}
valid_ipv4() {
local ip=$1
local stat=1
@ -71,6 +45,32 @@ valid_ipv6() {
fi
}
detect_ip_version() {
local ip=$1
if valid_ipv4 "$ip"; then
return 4;
elif valid_ipv6 "$ip"; then
return 6
else
return 0;
fi
}
valid_ip() {
local ip=$1
local iptype
detect_ip_version "$ip"
iptype=$?
case $iptype in
4) return 0;;
6) return 0;;
*) return 1;;
esac
}
getRecords() {
local file=$1
local r