From 7e34459aae60e065edc4ebae2550f55aff8ba612 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 8 Jan 2012 13:35:38 +0100 Subject: [PATCH] added auth using TR_AUTH env variable --- torrent/transmission-client.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/torrent/transmission-client.pl b/torrent/transmission-client.pl index 8bccb81..b6f1d4c 100755 --- a/torrent/transmission-client.pl +++ b/torrent/transmission-client.pl @@ -24,7 +24,13 @@ use Transmission::Client; my $action = shift @ARGV or _help(); -my $tc = Transmission::Client->new; +my ( $username, $password ) = split(/:/, $ENV{TR_AUTH} ); + +my $tc = Transmission::Client->new( + autodie => 1, + username => $username, + password => $password, +); if($action eq 'list') { printf "%3s %-34s %4s %4s %5s %5s\n", 'id', 'name', 'lcrs', 'sdrs', 'rate', 'eta'; -- 2.20.1