You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

19 lines
474 B

#!/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"