How To Update Blacklists For DansGuardian – Update Script

I just tossed together a simple bash script for updating Blacklists from Squidblacklist.org for DansGuardian under GNU/Linux or I suppose any platform with a bash shell would suffice, it isnt really that sophisticated, it is rather crude and gets the job done.

The blacklist update script for DansGuardian can be downloaded here. Remember that a valid username and password will be required for basic http authentication. To download these files one must subscribe. Get your own username and password today by subscribing to Squidblacklist.org here..

Here is the blacklist update script in plain text form.


#! /bin/bash
#
# DansGuardian Blacklist Updater Script v0.1 - Squidblacklist.org
# Thoughts or suggestions can be emailed to webmaster@squidblacklist.org
# You will need to change the wget line with your user account for authentication
#
# EXAMPLE:
# wget --http-user=USERNAME --http-password=PASSHERE --auth-no-challenge http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-prime.tar.gz
#
# Use this script to download and update blacklists for squid3 proxy
# You may need to edit this for your specific environment.
# you may optionaly wish to crontab this job so it will update at regular intervals
#
# Create the directories you want
# EXAMPLE: 'mkdir /etc/dansguardian/lists/blacklists/porn'
#
# Place this script within /etc/dansguardian/ directory
# Next, chmod +x squid-update.sh .That will make the script executable.
#
# nano /etc/crontab and add the following line
# 01 0 * * * root /etc/dansguardian/dg-update.sh
#
# URLS for DG ACL blacklists Are listed below.
#
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-all.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-prime.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-malicious.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-usg.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-piracy.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-porn.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-dating.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-ads.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-proxies.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-gaming.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-smedia.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-gambling.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-cp.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-blasphemy.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-file.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-image.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-video.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-pharma-rx.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-new-tlds.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-chanology.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-dyn.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-freeweb.tar.gz
# http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-racism.tar.gz
#
# Happy Updating.

echo Beginning squidblacklist.org Dansguardian Blacklist Update procedure... ;
cd /etc/dansguardian/ ;
echo Downloading blacklists...
# Easy to download blacklists, decompress and move to the proper directory.
wget --http-user=USERNAME --http-password=PASSHERE --auth-no-challenge http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-porn.tar.gz ;
tar -xvf dg-porn.tar.gz ;
mv dg-porn.acl /etc/dansguardian/lists/blacklists/porn/domains ;
wget --http-user=USERNAME --http-password=PASSHERE --auth-no-challenge http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-ads.tar.gz ;
tar -xvf dg-ads.tar.gz ;
mv dg-ads.acl /etc/dansguardian/lists/blacklists/ads/domains ;
wget --http-user=USERNAME --http-password=PASSHERE --auth-no-challenge http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-malicious.tar.gz ;
tar -xvf dg-malicious.tar.gz ;
mv dg-malicious.acl /etc/dansguardian/lists/blacklists/malicious/domains ;
wget --http-user=USERNAME --http-password=PASSHERE --auth-no-challenge http://www.squidblacklist.org/downloads/squidblacklists/dg/dg-chanology.tar.gz ;
tar -xvf dg-chanology.tar.gz ;
mv dg-chanology.acl /etc/dansguardian/lists/blacklists/chanology/domains ;
echo Cleaning up temporary files... ;
rm *.tar.gz ;
echo Reloading Dansguardian Service... ;
service dansguardian stop ;
service dansguardian start ;
echo Done.


Subscribe Today – Paypal or Credit Card Accepted.

Flat rate subscription. Select a membership option & subscribe.



Select Payment Option



  • You will be issued a username and password.
  • You will be granted access to our member area.
  • 3 Year Membership Option now available.
  • Contact us if you would like a pre order invoice.

Disclaimer: All sales are final, we do not issue refunds. Cancel your subscription anytime.

One Reply to “How To Update Blacklists For DansGuardian – Update Script”

Leave a Reply

Your email address will not be published. Required fields are marked *

*