Making p2pblocklist for qbittorrent

Share your own howto's etc. Not for support questions!

Making p2pblocklist for qbittorrent

Postby shirish » 2014-04-21 15:18

Hi all,
Here's a shell script to make a blocklist which can be used for qbittorrent :-

Code: Select all
##make a sub-directory and work therein
mkdir working
cd working

##backup old list
mv blocklst.p2p blocklst.p2p.old

## Get the lists

wget http://list.iblocklist.com/?list=bt_bogon -O bog-z
wget http://list.iblocklist.com/?list=bt_level1 -O l1-z
wget http://list.iblocklist.com/?list=bt_level2 -O l2-z
wget http://list.iblocklist.com/?list=bt_templist -O tmp-z
wget http://list.iblocklist.com/?list=bt_spyware -O spy-z
wget http://list.iblocklist.com/?list=bt_spider -O spi-z
wget http://list.iblocklist.com/?list=bt_ads -O ads-z
wget http://list.iblocklist.com/?list=bt_templist -O bp-z
wget http://list.iblocklist.com/?list=bt_hijacked -O hijack-z
wget http://list.iblocklist.com/?list=bt_dshield -O hack-z
wget http://list.iblocklist.com/?list=ijfqtofzixtwayqovmxn -O threat-z

## Merge the lists

cat bog-z l1-z l2-z tmp-z spi-z spy-z ads-z bp-z hijack-z hack-z threat-z > blocklst.p2p.gz

## Decompress

gunzip blocklst.p2p.gz

## Clean individual list files

rm -f *-z


This is just an update of the script made at https://forums.mageia.org/en/viewtopic.php?f=41&t=3612
Last edited by shirish on 2014-04-21 20:08, edited 2 times in total.
Intel Dual-Core CPU E5400 (soc 775) @ 2.70GHz, onboard Intel G33, Asus MB P5KPL-AM IN (Intel G31), D-Link 2750u modem+router, 64-bit Debian Testing, GNOME 3.14 Flashback.
shirish
 
Posts: 819
Joined: 2010-12-08 12:59

Re: Making p2pblocklist for qbittorrent

Postby confuseling » 2014-04-21 16:25

Code: Select all
rm -f *


:?

That's not a good idea...

The first reason being it'll delete everything the script created. The second being it'll delete anything that was in the present directory beforehand (possibly including the script...)

I'm by no means a knowledgeable shell scripter, but maybe try testing for the existence of a file / directory called 'working', or something similar. If the file / directory exists, abort the script. If it doesn't, create it, do everything you need to do inside, then delete the directory.
The Forum's search box is terrible. Use site specific search, e.g.
https://www.google.com/search?q=site%3A ... terms+here
confuseling
 
Posts: 2144
Joined: 2009-10-21 01:03

Re: Making p2pblocklist for qbittorrent

Postby shirish » 2014-04-21 20:06

confuseling wrote:
Code: Select all
rm -f *


:?

That's not a good idea...

The first reason being it'll delete everything the script created. The second being it'll delete anything that was in the present directory beforehand (possibly including the script...)

I'm by no means a knowledgeable shell scripter, but maybe try testing for the existence of a file / directory called 'working', or something similar. If the file / directory exists, abort the script. If it doesn't, create it, do everything you need to do inside, then delete the directory.


Oops, the correct thing was

Code: Select all
rm -f *-z


somehow forgot the rest of the thing, updated in the code posted above, although do agree the best would be to make a sub-directory, go into and then do the needful. Updated the script to share that as well.

I just know there is so much I don't know about shell scripting as well but we all have to start somewhere.
Intel Dual-Core CPU E5400 (soc 775) @ 2.70GHz, onboard Intel G33, Asus MB P5KPL-AM IN (Intel G31), D-Link 2750u modem+router, 64-bit Debian Testing, GNOME 3.14 Flashback.
shirish
 
Posts: 819
Joined: 2010-12-08 12:59


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable