Remove scanlist(), now in query.sh

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
pull/2234/head
Rob Gill 6 years ago committed by GitHub
parent 45a8eda49b
commit 2255d05664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,26 +86,6 @@ updateGravityFunc() {
exit 0
}
# Scan an array of files for matching strings
scanList(){
# Escape full stops
local domain="${1//./\\.}" lists="${2}" type="${3:-}"
# Prevent grep from printing file path
cd "/etc/pihole" || exit 1
# Prevent grep -i matching slowly: http://bit.ly/2xFXtUX
export LC_CTYPE=C
# /dev/null forces filename to be printed when only one list has been generated
# shellcheck disable=SC2086
case "${type}" in
"exact" ) grep -i -E -l "(^|\\s)${domain}($|\\s|#)" ${lists} /dev/null;;
"wc" ) grep -i -o -m 1 "/${domain}/" ${lists};;
* ) grep -i "${domain}" ${lists} /dev/null;;
esac
}
# Print each subdomain
# e.g: foo.bar.baz.com = "foo.bar.baz.com bar.baz.com baz.com com"
processWildcards() {

Loading…
Cancel
Save