1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 14:18:15 +00:00

Merge pull request #2249 from pi-hole/revert-2069-fix/nullbyte

Revert "Fix error: /opt/pihole/gravity.sh: 385: Warning: command substitution: ignored null byte in input"
This commit is contained in:
Dan Schaper 2018-06-25 08:35:09 -07:00 committed by GitHub
commit 2abaa60c2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -387,8 +387,9 @@ gravity_ConsolidateDownloadedBlocklists() {
if [[ -r "${i}" ]]; then
# Remove windows CRs from file, convert list to lower case, and append into $matterAndLight
tr -d '\r' < "${i}" | tr '[:upper:]' '[:lower:]' >> "${piholeDir}/${matterAndLight}"
# Ensure that the first line of a new list is on a new line
IFS= read -r -d '' lastLine <"${piholeDir}/${matterAndLight}" || [[ $lastLine ]]
lastLine=$(tail -1 "${piholeDir}/${matterAndLight}")
if [[ "${#lastLine}" -gt 0 ]]; then
echo "" >> "${piholeDir}/${matterAndLight}"
fi