| 1 | = Block List Updater Script = |
| 2 | == Notes == |
| 3 | If you start the daemon with arguments, either read how to modify the [EditConfigFiles configuration file] or change the last line.[[BR]] |
| 4 | If you have the [ConfigFiles configuration files] at a non standard location, you'll need to modify the {{{cd $HOME/.config/transmission-daemon/blocklists/}}} line near the end. |
| 5 | |
| 6 | == Script == |
| 7 | {{{ |
| 8 | #!/bin/sh |
| 9 | |
| 10 | PID="`pidof transmission-daemon`" |
| 11 | if [ -n "$PID" ]; then |
| 12 | kill $PID |
| 13 | fi |
| 14 | |
| 15 | echo -n "Waiting for the daemon to exit " |
| 16 | sleep 2 |
| 17 | |
| 18 | COUNT=1 |
| 19 | while [ -n "`pidof transmission-daemon`" ]; do |
| 20 | COUNT=$((COUNT + 1)) |
| 21 | if [ $COUNT -gt 60 ]; then |
| 22 | echo -n "transmission-daemon doesn't respond, killing it with -9" |
| 23 | kill -9 `pidof transmission-daemon` |
| 24 | break |
| 25 | fi |
| 26 | |
| 27 | sleep 2 |
| 28 | echo -n "." |
| 29 | done |
| 30 | |
| 31 | echo " done" |
| 32 | |
| 33 | cd $HOME/.config/transmission-daemon/blocklists/ |
| 34 | if wget http://www.bluetack.co.uk/config/level1.gz 1>/dev/null 2>&1 ; then |
| 35 | rm -f level1 && gunzip level1.gz |
| 36 | echo "blocklist updated" |
| 37 | else |
| 38 | echo "blocklist not updated" |
| 39 | fi |
| 40 | |
| 41 | transmission-daemon |
| 42 | }}} |
| 43 | |