1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

Check IPv6 to see if the route is reachable, if not, don't use.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2016-12-24 15:26:05 -08:00
parent ffd31d8330
commit da41383476
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -273,8 +273,11 @@ chooseInterface() {
useIPv6dialog() {
# Show the IPv6 address used for blocking
IPV6_ADDRESS=$(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
whiptail --msgbox --backtitle "IPv6..." --title "IPv6 Supported" "$IPV6_ADDRESS will be used to block ads." ${r} ${c}
IPV6_ADDRESS=$(ip -6 route get 2001:4860:4860::8888 | grep -v "unreachable" | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
if [[ ! -z "${IPV6_ADDRESS}" ]]; then
whiptail --msgbox --backtitle "IPv6..." --title "IPv6 Supported" "$IPV6_ADDRESS will be used to block ads." ${r} ${c}
fi
}