Remove scanlist(), now in query.sh
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
parent
45a8eda49b
commit
2255d05664
20
pihole
20
pihole
|
@ -86,26 +86,6 @@ updateGravityFunc() {
|
||||||
exit 0
|
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
|
# Print each subdomain
|
||||||
# e.g: foo.bar.baz.com = "foo.bar.baz.com bar.baz.com baz.com com"
|
# e.g: foo.bar.baz.com = "foo.bar.baz.com bar.baz.com baz.com com"
|
||||||
processWildcards() {
|
processWildcards() {
|
||||||
|
|
Loading…
Reference in New Issue