Updating the Transmission bittorrent software blocklist
If you use the Transmission bittorrent software for Ubuntu, you may have had a little bit of an issue updating your IP address blocklist within the program. I created a shell script that will help you do just that. All you need to do is first create a file called something like, “updateblocklists.sh” and fill it with the following script:
#!/bin/bash
BLOCKLISTDIR=”/var/lib/transmission-daemon/info/blocklists”
BASEURL=”http://www.bluetack.co.uk/config”echo “”
echo ” BEFORE UPDATING, LET’S DELETE ALL PREVIOUS BLOCKLIST DATA”
echo ” IF YOU RECEIVE AN ERROR, IGNORE IT. IT USUALLY MEANS YOU”
echo ” DON’T HAVE ANY BLOCKLIST INFORMATION DOWNLOADED YET”
echo “”
rm “$BLOCKLISTDIR”/*
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST level1.gz”
echo “”curl -L $BASEURL/level1.gz -o $BLOCKLISTDIR/level1.gz
gunzip -f $BLOCKLISTDIR/level1.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/level1 $BLOCKLISTDIR/level1.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST level2.gz”
echo “”curl -L $BASEURL/level2.gz -o $BLOCKLISTDIR/level2.gz
gunzip -f $BLOCKLISTDIR/level2.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/level2 $BLOCKLISTDIR/level2.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST level3.gz”
echo “”curl -L $BASEURL/level3.gz -o $BLOCKLISTDIR/level3.gz
gunzip -f $BLOCKLISTDIR/level3.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/level3 $BLOCKLISTDIR/level3.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST proxy.gz”
echo “”curl -L $BASEURL/proxy.gz -o $BLOCKLISTDIR/proxy.gz
gunzip -f $BLOCKLISTDIR/proxy.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/proxy $BLOCKLISTDIR/proxy.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST Microsoft.gz”
echo “”curl -L $BASEURL/Microsoft.gz -o $BLOCKLISTDIR/Microsoft.gz
gunzip -f $BLOCKLISTDIR/Microsoft.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/Microsoft $BLOCKLISTDIR/microsoft.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST edu.gz”
echo “”curl -L $BASEURL/edu.gz -o $BLOCKLISTDIR/edu.gz
gunzip -f $BLOCKLISTDIR/edu.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/edu $BLOCKLISTDIR/edu.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST hijacked.gz”
echo “”curl -L $BASEURL/hijacked.gz -o $BLOCKLISTDIR/hijacked.gz
gunzip -f $BLOCKLISTDIR/hijacked.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/hijacked $BLOCKLISTDIR/hijacked.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST spider.gz”
echo “”curl -L $BASEURL/spider.gz -o $BLOCKLISTDIR/spider.gz
gunzip -f $BLOCKLISTDIR/spider.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/spider $BLOCKLISTDIR/spider.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST spyware.gz”
echo “”curl -L $BASEURL/spyware.gz -o $BLOCKLISTDIR/spyware.gz
gunzip -f $BLOCKLISTDIR/spyware.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/spyware $BLOCKLISTDIR/spyware.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” DOWNLOADING AND UNZIPPING BLOCKLIST webexploit.gz”
echo “”curl -L $BASEURL/webexploit.gz -o $BLOCKLISTDIR/webexploit.gz
gunzip -f $BLOCKLISTDIR/webexploit.gzecho “”
echo ” RENAMING NEW BLOCKLIST FILE TO .txt”
echo “”
mv $BLOCKLISTDIR/webexploit $BLOCKLISTDIR/webexploit.txt
echo “”
echo ” DONE”
echo “”echo “”
echo ” RELOAD THE TRANSMISSION SERVICE SO CHANGES TAKE EFFECT”
echo “”
service transmission-daemon restart
echo “”
echo ” YOUR BLOCKLISTS HAVE BEEN UPDATED”
echo “”
Or you can download the above script by clicking here. When you download the file, you need to rename it from updateblocklists.txt to updateblocklists.sh so that you can run it from the command line. You need to make sure that you also run it using the sudo command if you aren’t logged in as root, otherwise the renaming and removing portions of the script won’t work. Also, be sure that in the script, you change the BLOCKLISTDIR variable at the beginning of the script to the correct path that points to your blocklist directory for Transmission. Currently this script downloads and processes the following blocklists from Bluetack Internet Security Solutions:
- level1
- level2
- level3
- proxy
- Microsoft
- edu
- hijacked
- spider
- spyware
- webexploit
This script currently, as of March 12th, 2012, adds 374,007 IP addresses to your Transmission blocklist. If there are any other blocklists you’d like added from Bluetack, don’t hesitate to let me know in the comments and I can amend the script as needed.





