Deleting Torrents with CLI

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
brisdude
Posts: 5
Joined: Wed May 23, 2018 10:36 am

Deleting Torrents with CLI

Post by brisdude »

I am deleting torrents as part of a shell script with the following line:

Code: Select all

/usr/local/Cellar/transmission/2.94/bin/transmission-remote -n admin:admin -t $REF -r | tr -d "\n");
($REF is the torrent id to be deleted and I am piping to tr to strip the newline character.)

I test whether this works with:

Code: Select all

if [ "$returnString" == 'localhost:9091/transmission/rpc/ responded: "success"' ]
	then ... ;
Even when the deletion is successful, next time the script is run it often finds the same torrent/s still running and so it deletes them again.

Apart from checking the return string, can anyone tell me a way to determine whether the torrent has actually been successfully deleted please?
Post Reply