PBLS4Lin v1.0 – Peerblock for Linux and Transmission

Um script para linux que permite utilizar as listas do Peerblock.
Estas listas podem ser utilizadas no Transmission.

#!/bin/bash

#This script creates the same lists as peerblock http://www.peerblock.com/, it outputs a file that you
#can use on Transmission under Edit -> Preferences -> Privacy -> Blocklist. In the first time copy the
#http link and use it. All lists are from http://www.iblocklist.com
#This script was created by Cesário Garcia Mil-Homens - http://www.cesariogarcia.com just for the fun.
#PBLS4Lin - v1.0

#CONFIGURATION - WARNING THE DIRECTORIES SHOULD ALREADY EXIST.

#Insert here the dir where is your Dropbox/Google Drive/etc public folders or you local server with apache
#Using Dropbox
#destination_folder="$HOME/Dropbox/Public"
#Using localhost
destination_folder="/var/www/peerblock"

#Insert here your own temporary download folder, do not use /tmp
temp="$HOME/tmp"

#DO NOT EDIT BELOW THIS LINE

clear
echo "Peerblock Lists - Automatic Uptades for Transmission"
echo "My destination folder is $destination_folder and my temporary download folder is $temp is this correct? (y/n)"

function download() {
	sudo cd $temp
	sudo wget -O - "http://list.iblocklist.com/?list=bt_ads&fileformat=p2p&archiveformat=gz" > bt_ads.txt.gz
	sudo wget -O - "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz" > bt_level1.txt.gz
	sudo wget -O - "http://list.iblocklist.com/?list=bt_spyware&fileformat=p2p&archiveformat=gz" > bt_spyware.txt.gz
	sudo gunzip *.gz
	}

function combine() {
	sudo cat bt_ads.txt bt_level1.txt bt_spyware.txt > peerblock.txt
	sudo rm bt_ads.txt
	sudo rm bt_level1.txt
	sudo rm bt_spyware.txt
	 }

function upload() {
	sudo mv -f peerblock.txt $destination_folder
	}

read op

case $op in
	y) download; combine; upload;;
	*) exit;;
esac

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.