Created
April 20, 2017 12:14
-
-
Save itavero/3a6bb491780bcd5d67b7fadd148fca44 to your computer and use it in GitHub Desktop.
Transmission auto remove
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
SERVER="9091 --auth user:pass" | |
TORRENTLIST=`transmission-remote $SERVER --list | grep 100% | sed "s/^ *//g" | cut -w -f1` | |
for TORRENTID in $TORRENTLIST | |
do | |
echo "Processing $TORRENTID" | |
TORRENT_INFO=`transmission-remote $SERVER --torrent $TORRENTID --info` | |
# Check if finished/done | |
echo $TORRENT_INFO | grep -oh "State: Seeding\|Stopped\|Finished\|Idle" | |
if [ $? == 0 ]; then | |
echo "Torrent #$TORRENTID is completed. Removing from list..." | |
transmission-remote $SERVER --torrent $TORRENTID --remove | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment