daily pastebin goal
90%
SHARE
TWEET

Deluge Unregistered Pause/Resume

a guest Jun 10th, 2017 852 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. torrentid=$1
  3. torrentname=$2
  4. torrentpath=$3
  5.  
  6. x=1
  7. while [ $x -le 100 ]
  8. do
  9. pause 2
  10. echo "Running $x times" >> ~/script.log
  11. echo "TorrentID: $torrentid" >> ~/script.log
  12. line=$(deluge-console "connect 127.0.0.1; info" $1 | grep "Tracker status")
  13. echo $line >> ~/script.log
  14. case "$line" in
  15. *unregistered*|*Sent*|*End*of*file*|*Bad*Gateway*)
  16. deluge-console "connect 127.0.0.1; pause '$torrentid'"
  17. sleep 5
  18. deluge-console "connect 127.0.0.1; 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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Pastebin PRO 'AUTUMN SPECIAL'!
Get 60% OFF Pastebin PRO accounts!
 
Top