Skip to content

Instantly share code, notes, and snippets.

@sshvetsov
Created April 24, 2013 07:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshvetsov/5450277 to your computer and use it in GitHub Desktop.
Save sshvetsov/5450277 to your computer and use it in GitHub Desktop.
Update Transmission block list
#!/bin/bash
# blocklist directory
BLOCKLISTDIR=/var/lib/transmission-daemon/info/blocklists
cd ${BLOCKLISTDIR}
if [ $? -eq 0 ]; then
if [ -f level1 ]; then
rm level1
fi
# if no blocklist file exist update blocklist
if [ ! -f level1 ]; then
wget -q -O level1.gz http://update.transmissionbt.com/level1.gz
# if download successful unzip it
if [ -f level1.gz ]; then
gunzip level1.gz
# if file extracted successfully reload transmission
if [ $? -eq 0 ]; then
chmod go+r level1
/etc/init.d/transmission-daemon reload
else
rm -f level1*
fi
fi
fi
cd - 2>&1 >/dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment