for hf in $blocked_domain $canaryDomains; do echo "$hf" | sed "$domainsFilter" >> $B_TMP; done
allowed_domain="${allowed_domain}
$(cat $A_TMP)"
- for hf in ${allowed_domain}; do hf="$(echo "$hf" | sed 's/\./\\./g')"; allow_filter="$allow_filter/^(.*\.)?${hf}$/d;"; done
+ for hf in ${allowed_domain}; do hf="$(echo "$hf" | sed 's/\./\\./g')"; allow_filter="$allow_filter/(^|\.)${hf}$/d;"; done
[ ! -s "$B_TMP" ] && return 1
for c in $string; do
output 2 " $c "
hf="$(echo "$c" | sed 's/\./\\./g')"
- if sed -i "/^${hf}$/d;/\.${hf}$/d;" "$outputFile" && \
+ if sed -i "/(^|\.)${hf}$/d;" "$outputFile" && \
uci_add_list_if_new "${packageName}" 'config' 'allowed_domain' "$c"; then
output_ok
else