From bffc77e47887f786d814945c71df35ae1f9d98c1 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 21 Feb 2016 17:45:25 +0000 Subject: [PATCH] Add support for comments and blank lines in adlists.default/adlists.list --- gravity.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 66b923b8..83700529 100755 --- a/gravity.sh +++ b/gravity.sh @@ -100,7 +100,12 @@ function gravity_collapse() { echo -n "::: Custom adList file detected. Reading..." sources=() while read -a line; do - sources+=($line) + #Do not read commented out or blank lines + if [[ $line = \#* ]] || [[ ! $line ]]; then + echo "" > /dev/null + else + sources+=($line) + fi done < $adListFile echo " done!" else @@ -108,7 +113,12 @@ function gravity_collapse() { echo -n "::: No custom adlist file detected, reading from default file..." sources=() while read -a line; do - sources+=($line) + #Do not read commented out or blank lines + if [[ $line = \#* ]] || [[ ! $line ]]; then + echo "" > /dev/null + else + sources+=($line) + fi done < $adListDefault echo " done!" fi