Good news: the original script was good for moving all torrents that belong to a tracker, since you probably only want to use this with one torrent (the one that just finished downloading, and the daemon is actually running the script), then you can use a simplified script:
Code: Select all
#!/bin/sh
#
# Move finished torrent if it comes from TRACKER (see below)
HOST=localhost
PORT=9091
USER=user
PASS=password
TR=/usr/bin/transmission-remote
REMOTE="$TR $HOST:$PORT -n $USER:$PASS"
DESTDIR="/mnt/sda1/download/music"
TRACKER="cyclingtorrents"
LIMIT=1.10
SPEED_LIMIT=100 # kB/s
ID=$TR_TORRENT_ID
$REMOTE -t $ID -it | grep -i "$TRACKER"
if [ $? -eq 0 ]; then
$REMOTE -t $ID --move "$DESTDIR"
echo "Moved $ID"
# Bonus: seed indefinitely
$REMOTE -t $ID --no-seedratio
# Bonus: limit torrents from other trackers
# (actually not needed if 'global seedratio' and 'global upload' are set)
else
$REMOTE -t $ID --seedratio $LIMIT --uplimit $SPEED_LIMIT
fi