From d3073e5e2391e4338251fc11bf2b52ddbcc22234 Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Thu, 14 Sep 2017 17:09:52 +1000 Subject: [PATCH] Fix array of unique $sourceDomains --- gravity.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index 354bb51e..39a0e75b 100755 --- a/gravity.sh +++ b/gravity.sh @@ -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