From 3b300a4d6ac8c1553b17c9334bea44557f78c944 Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Fri, 13 Oct 2017 11:42:49 +1100 Subject: [PATCH 1/2] Fix query option handling Signed off by WaLLy3K --- pihole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pihole b/pihole index 45f7ea92..8359ba45 100755 --- a/pihole +++ b/pihole @@ -154,7 +154,7 @@ Options: # Strip valid options, leaving only the domain and invalid options # This allows users to place the options before or after the domain - options=$(sed -E 's/ ?-(bp|adlists?|all|exact)//g' <<< "${options}") + options=$(sed -E 's/ ?-(bp|adlists?|all|exact) ?//g' <<< "${options}") # Handle remaining options # If $options contain non ASCII characters, convert to punycode From 80c40e605078767845b2663eeb516666aa7e410b Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Mon, 16 Oct 2017 10:12:27 +1100 Subject: [PATCH 2/2] Prevent full stop being interpreted as regex Signed off by WaLLy3K --- pihole | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pihole b/pihole index 8359ba45..839ea8cd 100755 --- a/pihole +++ b/pihole @@ -85,7 +85,8 @@ updateGravityFunc() { # Scan an array of files for matching strings scanList(){ - local domain="${1}" lists="${2}" type="${3:-}" + # Escape full stops + local domain="${1//./\\.}" lists="${2}" type="${3:-}" # Prevent grep from printing file path cd "/etc/pihole" || exit 1