Merge pull request #876 from brontide/list_fix

[bug] Grep was leaking a file not found if blacklist didn't exist
This commit is contained in:
Dan Schaper 2016-10-29 07:15:22 -07:00 committed by GitHub
commit bdaf961196
1 changed files with 2 additions and 2 deletions

View File

@ -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..."