Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Making p2pblocklist for qbittorrent

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
shirish
Posts: 845
Joined: 2010-12-08 12:59

Making p2pblocklist for qbittorrent

#1 Post by shirish »

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, Mate 1.26

confuseling
Posts: 2121
Joined: 2009-10-21 01:03

Re: Making p2pblocklist for qbittorrent

#2 Post by confuseling »

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

shirish
Posts: 845
Joined: 2010-12-08 12:59

Re: Making p2pblocklist for qbittorrent

#3 Post by shirish »

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, Mate 1.26

Post Reply