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

Require exact match

Updated to require an exact match to reduce false-positives, as suggested by DL6ER.

Signed-off-by: Ryan Knapper <ryanknapper@gmail.com>
This commit is contained in:
Ryan Knapper 2018-02-28 13:06:07 -05:00 committed by GitHub
parent f2b3752f3d
commit 5ecfc58e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,7 +346,7 @@ CustomizeAdLists() {
elif [[ "${args[2]}" == "disable" ]]; then
sed -i "\\@${args[3]}@s/^http/#http/g" "${list}"
elif [[ "${args[2]}" == "add" ]]; then
if [[ $(grep -c "${args[3]}" "${list}") -eq 0 ]] ; then
if [[ $(grep -c "^${args[3]}$" "${list}") -eq 0 ]] ; then
echo "${args[3]}" >> ${list}
fi
elif [[ "${args[2]}" == "del" ]]; then