mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Experimental output of matching line from shown warnings.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
839fe32042
commit
3c09cd4a3a
1 changed files with 23 additions and 1 deletions
24
gravity.sh
24
gravity.sh
|
@ -391,7 +391,29 @@ gravity_DownloadBlocklists() {
|
|||
fi
|
||||
|
||||
if [[ "${status}" -eq 0 && -n "${output}" ]]; then
|
||||
echo -e " Encountered non-critical SQL warnings. Please check the suitability of the list you're using!\\nSQL warnings:\\n${output}\\n"
|
||||
echo -e " Encountered non-critical SQL warnings. Please check the suitability of the lists you're using!\\n\\n SQL warnings:"
|
||||
local warning file line lineno
|
||||
while IFS= read -r line; do
|
||||
echo " - ${line}"
|
||||
warning="$(grep -oh "^[^:]*:[0-9]*" <<< "${line}")"
|
||||
file="${warning%:*}"
|
||||
lineno="${warning#*:}"
|
||||
if [[ -n "${file}" && -n "${lineno}" ]]; then
|
||||
echo -n " Line contains: "
|
||||
awk "NR==${lineno}" < ${file}
|
||||
fi
|
||||
done <<< "${output}"
|
||||
echo ""
|
||||
local file line
|
||||
while IFS= read -r line; do
|
||||
warning="$(grep -oh "^[^:]*:[0-9]*" <<< "${line}")"
|
||||
file="${warning%:*}"
|
||||
lineno="${warning#*:}"
|
||||
if [[ -n "${file}" && -n "${lineno}" ]]; then
|
||||
echo -n "Line contains: "
|
||||
awk "NR==${lineno}" < ${file}
|
||||
fi
|
||||
done <<< "${output}"
|
||||
fi
|
||||
|
||||
rm "${target}" > /dev/null 2>&1 || \
|
||||
|
|
Loading…
Reference in a new issue