diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 8d871c51..ce8d63e1 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -52,7 +52,7 @@ function HandleOther(){ validDomain=$(echo $1 | perl -ne'print if /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/') if [ -z "$validDomain" ]; then - echo $1 is not a valid argument or domain name + echo "::: $1 is not a valid argument or domain name" else domList=("${domList[@]}" $validDomain) fi @@ -76,17 +76,20 @@ function PopWhitelistFile(){ function AddDomain(){ #| sed 's/\./\\./g' bool=false + if $versbose; then + echo -n "::: Whitelisting $1...." + fi grep -Ex -q "$1" $whitelist || bool=true if $bool; then #domain not found in the whitelist file, add it! - if $versbose; then - echo "** Adding $1 to whitelist file" - fi - echo $1 >> $whitelist + echo $1 >> $whitelist modifyHost=true + if $versbose; then + echo " done!" + fi else if $versbose; then - echo "** $1 already whitelisted! No need to add" + echo " already whitelisted! No need to add" fi fi } @@ -98,7 +101,7 @@ function RemoveDomain(){ if $bool; then #Domain is not in the whitelist file, no need to Remove if $versbose; then - echo "** $1 is NOT whitelisted! No need to remove" + echo "::: $1 is NOT whitelisted! No need to remove" fi else #Domain is in the whitelist file, add to a temporary array and remove from whitelist file