SHARE
TWEET
Untitled
a guest
Aug 31st, 2018
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/bin/bash
- torrentid=$1
- torrentname=$2
- torrentpath=$3
- ip=deluge-ip
- port="deluge-port deluge-username deluge-password"
- x=1
- while [ $x -le 1000 ]
- do
- sleep 3
- echo "Running $x times" >> ~/script.log
- echo "TorrentID: $torrentid" >> ~/script.log
- line=$(deluge-console "connect $ip:$port; info" $1 | grep "Tracker status")
- echo $line >> ~/script.log
- case $line in
- *unregistered*|*Sent*|*End*of*file*|*Bad*Gateway*|*Error*)
- deluge-console "connect $ip:$port; pause $torrentid" >> ~/deluge.output 2>&1
- deluge-console "connect $ip:$port; resume $torrentid" >> ~/deluge.output 2>&1
- ;;
- *)
- case $line in
- *torrentleech*|*empirehost*|*iptorrents*|*stackoverflow*|*animebytes*)
- total_seeds=$(deluge-console "connect $ip:$port; info" $1 | grep "Seeds" | awk '{print $3}' | sed -r 's/\(|\)//g')
- connected_seeds=$(deluge-console "connect $ip:$port; info" $1 | grep "Seeds" | awk '{print $2}')
- echo "Seeds: $connected_seeds ($total_seeds)" >> ~/script.log
- if (( $connected_seeds > 0 )) || (( $total_seeds > 0 )); then
- echo "Found working torrent: $torrentname $torrentpath $torrentid" >> ~/script.log
- exit 1
- else
- deluge-console "connect $ip:$port; pause $torrentid" >> ~/deluge.output 2>&1
- deluge-console "connect $ip:$port; resume $torrentid" >> ~/deluge.output 2>&1
- fi
- ;;
- *)
- echo "Found working torrent: $torrentname $torrentpath $torrentid" >> ~/script.log
- exit 1
- ;;
- esac
- ;;
- esac
- x=$(( $x + 1 ))
- 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.

