Only check once for if this is a regex list or not.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-08-05 21:03:47 +02:00
parent a95b473417
commit 09190c1735
No known key found for this signature in database
GPG key ID: FB60471F0575164A

View file

@ -94,15 +94,19 @@ HandleOther() {
}
ProcessDomainList() {
local is_regexlist
if [[ "${listType}" == "regex_blacklist" ]]; then
# Regex black filter list
listname="regex blacklist filters"
is_regexlist=true
elif [[ "${listType}" == "regex_whitelist" ]]; then
# Regex white filter list
listname="regex whitelist filters"
is_regexlist=true
else
# Whitelist / Blacklist
listname="${listType}"
is_regexlist=false
fi
for dom in "${domList[@]}"; do
@ -115,7 +119,7 @@ ProcessDomainList() {
# if delmode then remove from desired list but do not add to the other
if ${addmode}; then
AddDomain "${dom}" "${listType}"
if [[ ! "${listType}" == "regex_"*"list" ]]; then
if ! ${is_regexlist}; then
RemoveDomain "${dom}" "${listAlt}"
fi
else