[download]

local/bin/trackers

   1 #!/bin/bash
   2 
   3 f=~/.cache/trackers
   4 
   5 [[ $(pidof transmission transmission-gtk) ]] || exit 1
   6 [[ $(date +%F) == $(date -r $f +%F) ]] || curl -s \
   7 https://ngosang.github.io/trackerslist/trackers_best.txt | sed '/^$/d' > $f
   8 
   9 while read id name; do
  10     echo "$name:"
  11     while read url; do
  12         transmission-remote -t $id -it | grep -qw "${url%/*}" && continue
  13         transmission-remote -t $id -td "$url" >&- && echo " + $url"
  14     done < $f
  15 done < <(
  16     transmission-remote -l |
  17     sed '1d; $d; s/\s\+\s/\t/g' |
  18     cut -f 2,10
  19 )