Bash Shell Script
No comment
Download Count: 108
Date Added: Sunday, 03-Jul-11 23:10:44 CDT
Tags: Transmission, shell script, public torrent, private torrent, Bit Torrent
For use with Transmission Bit Torrent Client (linux). Shell script to be called when torrent download completes. Determines if torrent tracker is public or private. Currently set to stop seeding if tracker is public.
Logs all completed torrents including completion time.
Could easily be modified to check for any other data. See my other script, Get Torrent Info, that shows most information available on a particular torrent.
Make sure the file is executable (chmod 755 public_torrent.sh), and preferably owned by the transmission client, on Ubuntu it is 'debian-transmission' (chown debian-transmission:debian-transmission public_torrent.sh).
File Name: public_torrent.sh - Code Type: Bash
#!/bin/bash { log=/var/lib/transmission-daemon/info/torrents.downloaded USER= PASSWD= public=$(transmission-remote -n $USER:$PASSWD -t $TR_TORRENT_ID -i\ | grep "Public torrent:"\ | cut -d: -f2-\ | sed 's/^ *//') echo " " >> $log echo "======-----------------======" >> $log echo "Download of no: $TR_TORRENT_ID - $TR_TORRENT_NAME completed on $TR_TIME_LOCALTIME " >> $log if [ $public = No ]; then echo -e "\t *** Seeding Non-Public Torrent ***" >> $log echo -e "\t *** Public Torrent = $public ***" >> $log else echo -e "\t *** Removed Public Torrent ***" >> $log echo -e "\t *** Public Torrent = $public ***" >> $log if ( transmission-remote -t$TR_TORRENT_ID --remove ); then echo "success" >> $log else echo "failure" >> $log fi fi echo "======-----------------======" >> $log }&
Parsed in 0.058 seconds - Rate: 15.95 KB/s - GeSHi version: 1.0.8.10
Hope you find this helpful! If you have any questions, please leave a comment.