Created
July 30, 2014 07:51
-
-
Save PizzaPete/cb1776a8170c38a24b47 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
TORRENTLIST=`transmission-remote --auth=user:password --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=' ' --fields=1` | |
for TORRENTID in $TORRENTLIST | |
do | |
echo "* * * * * Operations on torrent ID $TORRENTID starting. * * * * *" | |
DL_COMPLETED=`transmission-remote --auth=user:password --torrent $TORRENTID --info | grep "Percent Done: 100%"` | |
if [ "$DL_COMPLETED" != "" ]; then | |
echo "Torrent #$TORRENTID is completed." | |
echo "Removing torrent from list." | |
transmission-remote --auth=user:password --torrent $TORRENTID --remove | |
else | |
echo "Torrent #$TORRENTID is not completed. Ignoring." | |
fi | |
echo "* * * * * Operations on torrent ID $TORRENTID completed. * * * * *" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment