From ab24e617547f2376aeb8ef9aebc3a3b4479cac30 Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 13:45:00 -0400 Subject: [PATCH] change whitelist to whitelistFile --- advanced/Scripts/whitelist.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 82df27b0..e1dd27e9 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -50,8 +50,8 @@ HandleOther(){ PopWhitelistFile(){ #check whitelist file exists, and if not, create it - if [[ ! -f ${whitelist} ]];then - touch ${whitelist} + if [[ ! -f ${whitelistFile} ]];then + touch ${whitelistFile} fi for dom in "${domList[@]}" do @@ -67,13 +67,13 @@ AddDomain(){ #| sed 's/\./\\./g' bool=false - grep -Ex -q "$1" ${whitelist} || bool=true + grep -Ex -q "$1" ${whitelistFile} || bool=true if ${bool}; then #domain not found in the whitelist file, add it! if ${verbose}; then echo -n "::: Adding $1 to $whitelist..." fi - echo "$1" >> ${whitelist} + echo "$1" >> ${whitelistFile} if ${verbose}; then echo " done!" fi @@ -87,14 +87,14 @@ AddDomain(){ RemoveDomain(){ bool=false - grep -Ex -q "$1" ${whitelist} || bool=true + grep -Ex -q "$1" ${whitelistFile} || bool=true if ${bool}; then #Domain is not in the whitelist file, no need to Remove if ${verbose}; then echo "::: $1 is NOT whitelisted! No need to remove" fi else - echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} + echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelistFile} #reload gravity to pickup any entries this may have removed pihole -g fi @@ -113,7 +113,7 @@ DisplayWlist() { do echo "${count}: $RD" count=$((count+1)) - done < "$whitelist" + done < "$whitelistFile" } ###################################################