mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-16 16:34:07 +00:00
Extend %iface logic to the dig test. Also fix intentation in this function
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
0c6363572b
commit
00340136bd
1 changed files with 22 additions and 17 deletions
|
@ -765,6 +765,11 @@ dig_at() {
|
|||
addresses="$(ip address show dev "${iface}" | sed "/${sed_selector} /!d;s/^.*${sed_selector} //g;s/\/.*$//g;")"
|
||||
if [ -n "${addresses}" ]; then
|
||||
while IFS= read -r local_address ; do
|
||||
# If ${local_address} is an IPv6 link-local address, append the interface name to it
|
||||
if [[ "${local_address}" =~ ^fe80 ]]; then
|
||||
local_address="${local_address}%${iface}"
|
||||
fi
|
||||
|
||||
# Check if Pi-hole can use itself to block a domain
|
||||
if local_dig="$(dig +tries=1 +time=2 -"${protocol}" "${random_url}" @"${local_address}" "${record_type}")"; then
|
||||
# If it can, show success
|
||||
|
|
Loading…
Add table
Reference in a new issue