From 3da75d61253efe9ec293a5f747cf6d4fcd3e2698 Mon Sep 17 00:00:00 2001 From: Eric Warnke Date: Fri, 28 Oct 2016 17:28:04 -0400 Subject: [PATCH] Grep was leaking a file not found if blacklist didn't exist --- advanced/Scripts/list.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 4884e354..24f6d055 100644 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -82,7 +82,7 @@ AddDomain() { bool=true #Is the domain in the list we want to add it to? - grep -Ex -q "$1" ${list} || bool=false + grep -Ex -q "$1" ${list} > /dev/null 2>&1 || bool=false if [[ "${bool}" == false ]]; then #domain not found in the whitelist file, add it! @@ -104,7 +104,7 @@ RemoveDomain() { bool=true #Is it in the other list? Logic follows that if its whitelisted it should not be blacklisted and vice versa - grep -Ex -q "$1" ${list} || bool=false + grep -Ex -q "$1" ${list} > /dev/null 2>&1 || bool=false if [[ "${bool}" == true ]]; then # Remove it from the other one echo "::: Removing $1 from $list..."