Created
April 24, 2013 07:23
-
-
Save sshvetsov/5450277 to your computer and use it in GitHub Desktop.
Update Transmission block list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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