Use strict grep instead of regex for duplicates

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12 2018-06-28 22:59:15 -04:00
parent 55175087c4
commit cffb4de83b
No known key found for this signature in database
GPG key ID: ABB8FC9789AF524D

View file

@ -133,7 +133,7 @@ AddDomain() {
bool=true bool=true
# Is the domain in the list? # Is the domain in the list?
# Search only for exactly matching lines # Search only for exactly matching lines
grep -E "^${domain}$" "${regexlist}" > /dev/null 2>&1 || bool=false grep -Fx "${domain}" "${regexlist}" > /dev/null 2>&1 || bool=false
if [[ "${bool}" == false ]]; then if [[ "${bool}" == false ]]; then
if [[ "${verbose}" == true ]]; then if [[ "${verbose}" == true ]]; then
@ -177,7 +177,7 @@ RemoveDomain() {
[[ -z "${type}" ]] && type="--wildcard-only" [[ -z "${type}" ]] && type="--wildcard-only"
bool=true bool=true
# Is it in the list? # Is it in the list?
grep -E "^${domain}$" "${regexlist}" > /dev/null 2>&1 || bool=false grep -Fx "${domain}" "${regexlist}" > /dev/null 2>&1 || bool=false
if [[ "${bool}" == true ]]; then if [[ "${bool}" == true ]]; then
# Remove it from the other one # Remove it from the other one
echo -e " ${INFO} Removing $1 from regex list..." echo -e " ${INFO} Removing $1 from regex list..."