Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Transmission auto remove
#!/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
You can’t perform that action at this time.