grep whitelist misplaced

This commit is contained in:
pizzafritta 2015-03-30 22:59:18 +02:00
parent a8eda1c289
commit 5f931553b9

View file

@ -64,8 +64,9 @@ echo "Removing duplicates, whitelisting, and formatting the list of domains..."
grep -vhE "^\s*(#|$)" $tmpAdList| grep -vhE "^\s*(#|$)" $tmpAdList|
sed $'s/\r$//'| sed $'s/\r$//'|
awk -F. '{for (i=NF; i>1; --i) printf "%s.",$i;print $1}'| awk -F. '{for (i=NF; i>1; --i) printf "%s.",$i;print $1}'|
sort -t'.' -k1,2| uniq | grep -vwf $tmpWhiteList | sort -t'.' -k1,2| uniq |
awk -F. 'NR!=1&&substr($0,1,length(p))==p {next} {p=$0".";for (i=NF; i>1; --i) printf "%s.",$i;print $1}'| awk -F. 'NR!=1&&substr($0,1,length(p))==p {next} {p=$0".";for (i=NF; i>1; --i) printf "%s.",$i;print $1}'|
grep -vwf $tmpWhiteList |
awk -v "IP=$piholeIP" '{sub(/\r$/,""); print "address=/"$0"/"IP}' > $tmpConf awk -v "IP=$piholeIP" '{sub(/\r$/,""); print "address=/"$0"/"IP}' > $tmpConf
numberOfSitesWhitelisted=$(cat $tmpWhiteList | wc -l | sed 's/^[ \t]*//') numberOfSitesWhitelisted=$(cat $tmpWhiteList | wc -l | sed 's/^[ \t]*//')
numberOfSitesBlacklisted=$(cat $tmpBlackList | wc -l | sed 's/^[ \t]*//') numberOfSitesBlacklisted=$(cat $tmpBlackList | wc -l | sed 's/^[ \t]*//')