Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- torrentid=$1
- torrentname=$2
- torrentpath=$3
- #Change ip, port, username and password to reflect your specific instance.
- #Afterwards run 'chmod +x deluge-autoresume.sh' and add it to your execute in Deluge.
- ip=127.0.0.1
- port=58846
- username=localclient
- password=password
- x=1
- while [ $x -le 100 ]
- do
- sleep 2
- echo "Running $x times" >> /scripts/torrent/deluge_autoresume.log
- echo "TorrentID: $torrentid" >> /scripts/torrent/deluge_autoresume.log
- line=$(deluge-console "connect '$ip':'$port' '$username' '$password'; info -v $1" | grep "Tracker status")
- echo $line >> /scripts/torrent/deluge_autoresume.log
- case "$line" in
- *error*|*Error*|*Sent*|*End*of*file*|*Bad*Gateway*)
- deluge-console "connect '$ip':'$port' '$username' '$password'; pause '$torrentid'"
- sleep 5
- deluge-console "connect '$ip':'$port' '$username' '$password'; resume '$torrentid'"
- ;;
- *)
- echo "Found working torrent: $torrentname $torrentpath $torrentid" >> /scripts/torrent/deluge_autoresume.log
- exit 1;;
- esac
- x=$(( $x + 1 ))
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement