Changes between Initial Version and Version 1 of Scripts/BlockListUpdater


Ignore:
Timestamp:
Dec 14, 2008, 12:51:39 PM (12 years ago)
Author:
Waldorf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/BlockListUpdater

    v1 v1  
     1= Block List Updater Script =
     2== Notes ==
     3If you start the daemon with arguments, either read how to modify the [EditConfigFiles configuration file] or change the last line.[[BR]]
     4If 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
     10PID="`pidof transmission-daemon`"
     11if [ -n "$PID" ]; then
     12        kill $PID
     13fi
     14
     15echo -n "Waiting for the daemon to exit "
     16sleep 2
     17
     18COUNT=1
     19while [ -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 "."
     29done
     30
     31echo " done"
     32
     33cd $HOME/.config/transmission-daemon/blocklists/
     34if 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"
     37else
     38        echo "blocklist not updated"
     39fi
     40
     41transmission-daemon
     42}}}
     43