1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-17 21:59:55 +00:00

Fix array of unique $sourceDomains

This commit is contained in:
WaLLy3K 2017-09-14 17:09:52 +10:00 committed by GitHub
parent 34ae4844fa
commit d3073e5e23

View File

@ -388,9 +388,7 @@ gravity_WhitelistBLD() {
echo -ne " ${INFO} ${str}..."
# Create array of unique $sourceDomains
# Disable SC2046 as quoting will only return first domain
# shellcheck disable=SC2046
read -r -a uniqDomains <<< $(awk '{ if(!a[$1]++) { print $1 } }' <<< "$(printf '%s\n' "${sourceDomains[@]}")")
mapfile -t uniqDomains <<< "$(awk '{ if(!a[$1]++) { print $1 } }' <<< "$(printf '%s\n' "${sourceDomains[@]}")")"
${WHITELIST_COMMAND} -nr -q "${uniqDomains[*]}" > /dev/null