#!/bin/sh
|
|
|
|
BLOCKLIST_FILE="$HOME/.config/deluge/blocklist.dat"
|
|
BLOCKLIST_DIR=$(dirname "$BLOCKLIST_FILE")
|
|
mkdir -p "$BLOCKLIST_DIR"
|
|
|
|
TEMPDIR=$(mktemp -d) || exit 1
|
|
cd "$TEMPDIR" || exit 1
|
|
|
|
curl --silent --show-error --location \
|
|
http://list.iblocklist.com/?list=bt_level[1-3] \
|
|
--output "$TEMPDIR/bt_level#1.gz"
|
|
gunzip --force "$TEMPDIR"/*.gz
|
|
|
|
sort --unique --output="$BLOCKLIST_FILE" "$TEMPDIR"/bt_level*
|
|
rm "$TEMPDIR"/bt_level*
|
|
rmdir "$TEMPDIR"
|
|
|
|
wc -l "$BLOCKLIST_FILE"
|