From 322cb2387b5ac49385b2b533123257544c1eb47b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 13 Jan 2017 11:02:51 +0100 Subject: [PATCH] Also accept the last line of the adlist file if there is no newline at the end --- gravity.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index b5a3765c..324947bf 100755 --- a/gravity.sh +++ b/gravity.sh @@ -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