Your Ad Here

Tuesday, April 6, 2010

rTorrent: Recieve text messages when torrents are done! (With Gmail)

Maybe you have heard of rTorrent, maybe you haven't. But here's a little trick you should use that will make rTorrent your favorite torrent client!

*NOTE: These instructions are for Arch Linux. Your mileage may vary.

First, let's get/update rTorrent

# pacman -Sy rtorrent
(If you installing rtorrent for the first time, please follow these instructions to get everything else setup)

And we'll need Heriloom's mailx program.

# pacman -S mailx-heirloom

Alrighty. Now, we're going to delete the /etc/nail.rc and then remake it.

# rm /etc/nail.rc
# touch /etc/nail.rc

Now edit with your favorite editor (I chose nano, but anything should work)
# nano /etc/nail.rc
And add this. (Where USERNAME is your username for gmail and PASSWORD is your password for gmail)
set smtp=smtp.gmail.com:587
set smtp-use-starttls
set ssl-verify=ignore
set ssl-auth=login
set smtp-auth-user=USERNAME@gmail.com
set smtp-auth-password=PASSWORD

Okay, now let's create our script.
$ touch ~/.mail.sh

Okay so here's where you need to find out what your email-to-text is.
Verizon: 10digitphonenumber@vtext.com
AT&T: 10digitphonenumber@txt.att.net
Former AT&T customers: 10digitphonenumber@mmode.com
Sprint: 10digitphonenumber@messaging.sprintpcs.com
T-Mobile: 10digitphonenumber@tmomail.net
Nextel: 10digitphonenumber@messaging.nextel.com
Cingular: 10digitphonenumber@cingularme.com
Virgin Mobile: 10digitphonenumber@vmobl.com
Alltel: 10digitphonenumber@alltelmessage.com OR
10digitphonenumber@message.alltel.com
CellularOne: 10digitphonenumber@mobile.celloneusa.com
Omnipoint: 10digitphonenumber@omnipointpcs.com
Qwest: 10digitphonenumber@qwestmp.com

I have sprint, but change the script to fit your needs.

So let's edit out script.
$ nano ~/.mail.sh
And add
echo "$@: Done" | mailx 5555555555@messaging.sprintpcs.com
Now we need to make it executable.
$ chmod +x ~/.mail.sh

Okay that's done. Basically, what that's going to do is take whatever is passed to it ($@): Done and pipe it through mailx which goes back to /etc/nail.rc to login into your gmail account and send you an SMS.

Now, we need to add a line to the bottom our ~/.rtorrent file (you should have one, if not go back to the top)
$ nano ~/.rtorrent
and add:
system.method.set_key = event.download.finished,notify_me,"execute=~/.mail.sh,$d.get_name="

So say you were downloading "Completely-Legal-Files.rar". When it gets done, you'll get a text message that says "Completely-Legal-Files.rar: Done"

Oh happy day! Now you can rush home and un-rar it!

No comments:

Post a Comment