From a5f2305947be553910fe25ae6cce3f82e7b9351d Mon Sep 17 00:00:00 2001 From: Jesse Becker Date: Sat, 12 Sep 2015 00:05:19 -0400 Subject: [PATCH] Check if files are readible, not just present --- gravity.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 3ecca983..b6316ab2 100755 --- a/gravity.sh +++ b/gravity.sh @@ -131,7 +131,7 @@ echo "** Aggregating list of domains..." find $origin/ -type f -name "*.$justDomainsExtension" -exec cat {} \; | tr -d '\r' > $origin/$matter # Append blacklist entries if they exist -if [[ -f $blacklist ]];then +if [[ -r $blacklist ]];then numberOf=$(cat $blacklist | sed '/^\s*$/d' | wc -l) echo "** Blacklisting $numberOf domain(s)..." cat $blacklist >> $origin/$matter @@ -159,7 +159,7 @@ function gravity_advanced() } # Whitelist (if applicable) then remove duplicates and format for dnsmasq -if [[ -f $whitelist ]];then +if [[ -r $whitelist ]];then # Remove whitelist entries numberOf=$(cat $whitelist | sed '/^\s*$/d' | wc -l) plural=; [[ "$numberOf" != "1" ]] && plural=s