Also validate IPV6 in the setdns function

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2020-06-23 20:38:18 +01:00
parent 3aaf9d89b3
commit 3205606fc3
No known key found for this signature in database
GPG key ID: 872950F3ECF2B173
2 changed files with 19 additions and 1 deletions

View file

@ -260,7 +260,7 @@ SetDNSServers() {
local ip
ip="${array[index]//\\#/#}"
if valid_ip "${ip}" ; then
if valid_ip "${ip}" || valid_ip6 "${ip}" ; then
add_setting "PIHOLE_DNS_$((index+1))" "${ip}"
else
echo -e " ${CROSS} Invalid IP has been passed"