Dansguardian Randomise Rules

If you plan to use URLBlacklist.com or Shalla rules in Dansguardian you may suffer from very slow (or impossible) restarts of the daemon. Dansguardian prefers the rules randomized rather than in alphabetical order. I couldn’t find the randomize lines package in the repos so compiled it first e.g.:

wget http://arthurdejong.org/rl/rl-0.2.7.tar.gz
tar xzf rl-0.2.7.tar.gz
cd rl-0.2.7
./configure
make
make install

Then to randomize the rules I created a small shell script (so I can automate it in future) as follows:

vi /etc/dansguardian/lists/randomize.sh

#!/bin/bash
cd /etc/dansguardian/lists/blacklists; find . -type f -exec rl ‘{}’ -o ‘{}’.tmp \; -exec mv -f ‘{}’.tmp ‘{}’ \;

Dansguardian then restarts much faster.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>