diff --git a/advanced/Scripts/query.sh b/advanced/Scripts/query.sh index 4061e17c..99c1cf0f 100755 --- a/advanced/Scripts/query.sh +++ b/advanced/Scripts/query.sh @@ -57,12 +57,12 @@ options=$(sed -E 's/ ?-(all|exact) ?//g' <<< "${options}") case "${options}" in "" ) str="No domain specified";; *" "* ) str="Unknown query option specified";; - *[![:ascii:]]* ) domainQuery=$(idn2 "${options}");; - * ) domainQuery="${options}";; + *[![:ascii:]]* ) rawDomainQuery=$(idn2 "${options}");; + * ) rawDomainQuery="${options}";; esac # convert the domain to lowercase -domainQuery=$(echo "${domainQuery}" | tr '[:upper:]' '[:lower:]') +domainQuery=$(echo "${rawDomainQuery}" | tr '[:upper:]' '[:lower:]') if [[ -n "${str:-}" ]]; then echo -e "${str}${COL_NC}\\nTry 'pihole -q --help' for more information." @@ -82,7 +82,7 @@ scanList(){ # /dev/null forces filename to be printed when only one list has been generated case "${list_type}" in - "exact" ) grep -i -E -l "(^|(?/dev/null;; + "exact" ) grep -i -E -l "(^|(?/dev/null;; # Iterate through each regexp and check whether it matches the domainQuery # If it does, print the matching regexp and continue looping # Input 1 - regexps | Input 2 - domainQuery @@ -92,7 +92,7 @@ scanList(){ printf "%b\n" "${list}"; fi done;; - * ) grep -i "${esc_domain}" ${lists} /dev/null 2>/dev/null;; + * ) grep -i "${esc_domain}" "${lists}" /dev/null 2>/dev/null;; esac }