Also accept the last line of the adlist file if there is no newline at the end

This commit is contained in:
DL6ER 2017-01-13 11:02:51 +01:00
parent 10f77df8bb
commit 322cb2387b
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -76,7 +76,7 @@ gravity_collapse() {
#custom file found, use this instead of default
echo -n "::: Custom adList file detected. Reading..."
sources=()
while read -r line; do
while IFS= read -r line || [[ -n "$line" ]]; do
#Do not read commented out or blank lines
if [[ ${line} = \#* ]] || [[ ! ${line} ]]; then
echo "" > /dev/null
@ -89,7 +89,7 @@ gravity_collapse() {
#no custom file found, use defaults!
echo -n "::: No custom adlist file detected, reading from default file..."
sources=()
while read -r line; do
while IFS= read -r line || [[ -n "$line" ]]; do
#Do not read commented out or blank lines
if [[ ${line} = \#* ]] || [[ ! ${line} ]]; then
echo "" > /dev/null