Add support for comments and blank lines in adlists.default/adlists.list

This commit is contained in:
Promofaux 2016-02-21 17:45:25 +00:00
parent 4a1e88f4bf
commit bffc77e478
1 changed files with 12 additions and 2 deletions

View File

@ -100,7 +100,12 @@ function gravity_collapse() {
echo -n "::: Custom adList file detected. Reading..."
sources=()
while read -a line; do
#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
#Do not read commented out or blank lines
if [[ $line = \#* ]] || [[ ! $line ]]; then
echo "" > /dev/null
else
sources+=($line)
fi
done < $adListDefault
echo " done!"
fi