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