Experimental output of matching line from shown warnings.

Signed-off-by: DL6ER <dl6er@dl6er.de>
pull/3150/head
DL6ER 4 years ago
parent 839fe32042
commit 3c09cd4a3a
No known key found for this signature in database
GPG Key ID: FB60471F0575164A

@ -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…
Cancel
Save