Guest User

Untitled

a guest
Mar 27th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/bin/bash
  2. torrentid=$1
  3. torrentname=$2
  4. torrentpath=$3
  5.  
  6. x=1
  7. while [ $x -le 100 ]
  8. do
  9. sleep 2
  10. echo "Running $x times" >> ~/script.log
  11. echo "TorrentID: $torrentid" >> ~/script.log
  12. line=$(deluge-console "connect 127.0.0.1:52679; info" $1 | grep "Tracker status")
  13. echo $line >> ~/script.log
  14. case "$line" in
  15. *unregistered*|*Sent*|*End*of*file*|*Bad*Gateway*|torrentleech.org*Error*Connection*Timed*Out*|*Connection*Time*Out*|Error*Connection*Timed*Out*|Tracker status:*torrentleech.org*Error*Connection*Timed*Out*)
  16. deluge-console "connect 127.0.0.1:52679; pause '$torrentid'"
  17. sleep 3
  18. deluge-console "connect 127.0.0.1:52679; resume '$torrentid'"
  19. ;;
  20. *)
  21. echo "Found working torrent: $torrentname $torrentpath $torrentid" >> ~/script.log
  22. exit 1;;
  23. esac
  24. x=$(( $x + 1 ))
  25. done
Advertisement
Add Comment
Please, Sign In to add comment