mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-18 06:08:21 +00:00
Add support for comments and blank lines in adlists.default/adlists.list
This commit is contained in:
parent
4a1e88f4bf
commit
bffc77e478
14
gravity.sh
14
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
|
||||
|
Loading…
Reference in New Issue
Block a user