tails_torrent.sh 572 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. parent_path=$(dirname $(realpath $0))
  3. cd "$parent_path"
  4. new=$(lynx --dump --nonumbers https://tails.boum.org/torrents/files/ | grep "\.torrent")
  5. lastname=$(basename "$0" | cut -d. -f1).last
  6. old=$(cat $lastname)
  7. #echo "$new"
  8. #echo "$old"
  9. if [ "$old" != "$new" ]; then
  10. while IFS= read -r line; do
  11. echo $line
  12. transmission-remote --auth transmission:transmission --add $line --no-downlimit --no-uplimit --no-seedratio --download-dir /mnt/torrent/downloads/tails
  13. done <<< $(echo "$new" | grep "^http")
  14. echo "$new" > $lastname
  15. fi