Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- USER=felhasználónév
- PASSWD=jelszó
- log=removedtorrents.log
- MOVEDIR=/DataVolume/shares/Downloads/\!/\!Delete
- TORRENTLIST=`transmission-remote --auth=$USER:$PASSWD --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=' ' --fields=1`
- for TORRENTID in $TORRENTLIST
- do
- UP_COMPLETED=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "State: Finished"`
- DL_COMPLETED=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Percent Done: 100%"`
- SEED_COMPLETED=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Seeding.*2 days.*hour.*"`
- RATIO_COMPLETED=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Ratio: 1."`
- SEED_COMPLETED_BH=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Seeding.*hour"`
- TRACKER_BH=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info-trackers | grep "trackerneve"`
- TRACKER=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info-trackers | grep "Tracker"`
- RATIO=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Ratio:"`
- SEED=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Seeding Time:"`
- NAME=`transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --info | grep "Name:"`
- if [ "$DL_COMPLETED" != "" ]; then
- # Seed 48h, 1.0 ratio, finished
- if [ "$UP_COMPLETED" != "" ] || [ "$SEED_COMPLETED" != "" ] || [ "$RATIO_COMPLETED" != "" ]; then
- transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --move $MOVEDIR
- transmission-remote --auth=$USER:$PASSWD --torrent $TORRENTID --remove
- echo -e " \e[1;33m#$TORRENTID -\e[0;36m$NAME. \e[00;32mCompleted. Removing torrent.\e[00m"
- echo -e " \e[1;35m$RATIO\e[00m, $SEED"
- date +"%Y/%m/%d %H:%M" >> $log
- echo " #$TORRENTID$NAME. Download and Upload completed. Torrent has been moved and removed." >> $log
- echo " $RATIO, $SEED" >> $log
- echo >> $log
- else
- echo -e " \e[1;33m#$TORRENTID -\e[0;36m$NAME. \e[00;31mNot completed. Ignoring.\e[00m"
- echo -e " \e[0;35m$RATIO\e[00m, $SEED"
- fi
- fi
- echo
- echo
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement