Comment 4 for bug 316816

Revision history for this message
Adam Cecile (Le_Vert) (gandalf-le-vert) wrote :

Hello,

Current adblock list add new patterns that makes squidguard segfaulting again.

Here is the script I use:

#!/bin/sh

temp=`mktemp`
wget --no-check-certificate -O ${temp} http://easylist.adblockplus.org/adblock_rick752.txt

mkdir -p /var/lib/squidguard/db/adblock
rm -f /var/lib/squidguard/db/adblock/expressions

sed -e '/@@.*/d' -e '/^!.*/d' -e '/^\[.*\]$/d' -e 's#http://#^#g' -e 's,[.?=&/|()[],\\&,g' -e 's#*#.*#g' -e 's,\$.*$,,g' ${temp} > /var/lib/squidguard/db/adblock/expressions
sed -i -e 's/^-/\\-/' -e 's/^\+/\\+/' /var/lib/squidguard/db/adblock/expressions

echo 'deezer\.purl\.fr\/php\/zone\/ad' >> /var/lib/squidguard/db/adblock/expressions

update-squidguard

chown proxy.proxy -R /var/lib/squidguard/db/adblock

rm -f ${temp}

The new line are:
+adverts\/
-ad\.html
-banner-ads\/

That are turned into (with the second sed:)
\+adverts\/
\-ad\.html
\-banner-ads\/

Regards, Adam.