NSLU2-Linux
view · edit · print · history

Optware.Transmission History

Hide minor edits - Show changes to markup

November 13, 2014, at 05:31 AM by SRS -- Automatically parse a text file in "watched" folder for magnet links
Changed line 53 from:

September 22, 2014

to:

November 12, 2014

Changed lines 57-58 from:

September 22, 2014 changes:

to:

November 12, 2014 changes:

Changed line 86 from:

September 22, 2014

to:

November 12, 2014

September 22, 2014, at 09:31 PM by SRS -- added run script on torrent add, plus other bug fixes
Changed line 53 from:

August 8, 2014

to:

September 22, 2014

Changed lines 57-58 from:

August 8, 2014 changes:

to:

September 22, 2014 changes:

Changed lines 64-68 from:

How to stream the torrent's file(s):

http:// github.com/cfpp2p/transmission/wiki/Streaming-of-torrent-files---how-to

to:

Easy guide to stream the torrent's file(s):

http:// sourceforge.net/p/transmissiondaemon/discussion/general/thread/57f64ca4/

Other non-official enhancements:

http://sourceforge.net/p/transmissiondaemon/discussion/general/

Changed lines 78-79 from:

along with many other helpful enhancements: http:// sourceforge.net/p/transmissiondaemon/discussion/general/

to:
Changed line 86 from:

August 8, 2014

to:

September 22, 2014

August 08, 2014, at 07:11 PM by SRS -- added streaming of the torrent's files, plus minor bug fixes
Changed line 53 from:

July 12, 2014

to:

August 8, 2014

Changed lines 57-58 from:

July 12, 2014 changes:

to:

August 8, 2014 changes:

Changed lines 64-66 from:

all bug fixes and enhancements through current version 2.77+ (core) and 2.83+ (except rename)

to:

How to stream the torrent's file(s):

http:// github.com/cfpp2p/transmission/wiki/Streaming-of-torrent-files---how-to

all bug fixes and enhancements through current version 2.77+ (core) and 2.84+ (trunk, except rename)

Added lines 75-76:

along with many other helpful enhancements: http:// sourceforge.net/p/transmissiondaemon/discussion/general/

Changed line 83 from:

July 12, 2014

to:

August 8, 2014

Changed lines 121-124 from:

June 6, 2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-053014.zip (Windows ONLY) June 6, 2014

to:

August 8, 2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-080614.zip (Windows ONLY) August 8, 2014

July 12, 2014, at 06:22 AM by SRS -- proper fix for https://trac.transmissionbt.com/changeset/14303/
Changed line 53 from:

June 27, 2014

to:

July 12, 2014

Changed lines 57-58 from:

June 27, 2014 changes:

to:

July 12, 2014 changes:

Changed line 77 from:

June 27, 2014

to:

July 12, 2014

June 27, 2014, at 06:38 PM by SRS -- synchronization with 2.83+ release (except rename)
Changed line 53 from:

June 6, 2014

to:

June 27, 2014

Changed lines 57-58 from:

June 6, 2014 changes:

to:

June 27, 2014 changes:

Changed lines 65-66 from:

all bug fixes and enhancements through current version 2.77+ (core) and 2.82+ (except rename)

to:

all bug fixes and enhancements through current version 2.77+ (core) and 2.83+ (except rename)

Changed line 77 from:

June 6, 2014

to:

June 27, 2014

June 06, 2014, at 10:09 PM by SRS -- updates to DHT, bug fixes and GUI update
Changed line 53 from:

February 1, 2014

to:

June 6, 2014

Changed lines 57-58 from:

For changes see:

to:

June 6, 2014 changes:

http:// github.com/cfpp2p/transmission/wiki/2.8x-branch-2.77-core

Changed line 77 from:

February 1, 2014

to:

June 6, 2014

Deleted line 87:
Changed lines 114-117 from:

04/02/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-040214.zip (Windows ONLY) 04/02/2014

to:

June 6, 2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-053014.zip (Windows ONLY) June 6, 2014

April 02, 2014, at 11:20 PM by SRS -- GUI sort selection fixes
Changed lines 113-116 from:

04/01/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-040114.zip (Windows ONLY) 04/01/2014

to:

04/02/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-040214.zip (Windows ONLY) 04/02/2014

April 01, 2014, at 04:10 AM by SRS -- GUI bug fix
Changed lines 113-116 from:

03/26/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-032614.zip (Windows ONLY) 03/26/2014

to:

04/01/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-040114.zip (Windows ONLY) 04/01/2014

March 26, 2014, at 03:16 PM by SRS -- New remote GUI
Changed lines 113-114 from:
to:

03/26/2014 A very good update to the remote GUI is ready:

http:// transmissionbt.net/Win_GUI-032614.zip (Windows ONLY) 03/26/2014

This newer one has enhancements and fixes over the older one. Recommend.

.

February 01, 2014, at 03:21 AM by SRS -- minor security and bug fixes
Changed lines 53-54 from:

January 15, 2014

to:

February 1, 2014

Changed line 75 from:

January 15, 2014

to:

February 1, 2014

January 15, 2014, at 07:44 PM by SRS -- bug fixes and new download link
Changed line 54 from:

December 2, 2013

to:

January 15, 2014

Changed lines 56-59 from:

http:// computerfixpro.com/transmission273p.zip

Enhancements to daemon and web client

to:

http:// transmissionbt.net/transmission273p.zip

For changes see:

Changed line 76 from:

December 2, 2013

to:

January 15, 2014

Changed lines 78-79 from:

http:// computerfixpro.com/transmission273p.zip

to:

http:// transmissionbt.net/transmission273p.zip

December 02, 2013, at 11:27 PM by SRS -- daemon and web client enhancements
Added line 87:
December 02, 2013, at 11:23 PM by SRS -- d
Changed lines 54-57 from:

September 16, 2013 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.77+ (core) and 2.82+ (except rename)

to:

December 2, 2013 Download the pre-built .ipk from here: http:// computerfixpro.com/transmission273p.zip

Enhancements to daemon and web client

Changed lines 61-65 from:
to:

http:// github.com/cfpp2p/transmission/commits/master

all bug fixes and enhancements through current version 2.77+ (core) and 2.82+ (except rename)

Changed lines 76-77 from:

09/16/2013

to:

December 2, 2013

September 17, 2013, at 02:41 AM by SRS -- update 2.77+ core and 2.82+ bug fixes & enhancements
Changed lines 54-57 from:

July 12, 2013 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.77+

to:

September 16, 2013 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.77+ (core) and 2.82+ (except rename)

Changed line 71 from:

07/12/2013 v2.73+ r14074

to:

09/16/2013

Changed lines 98-99 from:

dont forget:

to:

don't forget:

Changed lines 112-113 from:

http:// computerfixpro.com/WIN_GUI.zip (Windows ONLY) 07/12/2013

to:

http:// computerfixpro.com/WIN_GUI.zip (Windows ONLY) 09/16/2013

July 13, 2013, at 05:27 AM by SRS -- Transmission 2.77+
Changed line 71 from:

07/12/2012 v2.73+ r14074

to:

07/12/2013 v2.73+ r14074

July 13, 2013, at 05:23 AM by SRS -- Transmission 2.77+
Added line 71:

07/12/2012 v2.73+ r14074

Changed lines 73-74 from:

http:// computerfixpro.com/transmission273p.zip 07/12/2012 v2.73+ r14074

to:

http:// computerfixpro.com/transmission273p.zip

July 12, 2013, at 08:00 PM by SRS -- Transmission 2.77+
Changed lines 56-57 from:

all bug fixes and enhancements through current version 2.77

to:

all bug fixes and enhancements through current version 2.77+

July 12, 2013, at 07:16 PM by SRS -- Transmission 2.77+
Changed lines 58-59 from:

github.com/cfpp2p/transmission/commits/svn/trunk

to:

http:// github.com/cfpp2p/transmission/commits/svn/trunk

Changed lines 68-70 from:

reference: trac.transmissionbt.com/ticket/532#comment:148

to:

reference: http:// trac.transmissionbt.com/ticket/532#comment:148

July 12, 2013, at 07:15 PM by SRS -- Transmission 2.77+
Changed lines 54-57 from:

12/27/2012 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.75

to:

July 12, 2013 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.77

github.com/cfpp2p/transmission/commits/svn/trunk

Changed lines 68-70 from:

reference: http:// trac.transmissionbt.com/ticket/532#comment:148

to:

reference: trac.transmissionbt.com/ticket/532#comment:148

Changed lines 72-73 from:

http:// computerfixpro.com/transmission273p.zip 12/27/2012 v2.73+ r13646

to:

http:// computerfixpro.com/transmission273p.zip 07/12/2012 v2.73+ r14074

Changed lines 101-102 from:

Version: 2.42+-1

to:

Version: 2.77+-1

Changed lines 109-112 from:

Here is a very very nice Graphical User Interface for transmission 2.42+

http:// computerfixpro.com/WIN_GUI.zip (Windows ONLY)

to:

Here is a very very nice Graphical User Interface for transmission 2.77+

http:// computerfixpro.com/WIN_GUI.zip (Windows ONLY) 07/12/2013

December 31, 2012, at 07:44 PM by SRS -- Transmission 2.73+ optimized for NSLU2
Added line 69:

Download the pre-built .ipk from here:

Changed lines 72-75 from:
to:

you can review and/or compile the source code for the above at: http:// github.com/cfpp2p/transmission/wiki

December 27, 2012, at 08:30 AM by SRS -- Transmission 2.73+ optimized for NSLU2
Changed lines 52-57 from:

Transmission 2.42+

06/05/2012 NOW below is download for v2.52+

security patches and assorted bug fixes included

to:

Transmission 2.73+

12/27/2012 NOW below is download for v2.73+

all bug fixes and enhancements through current version 2.75

and optimized for NSLU2.

Changed lines 62-63 from:

both working very nicely, very stable.

to:

Working very nicely, extremely stable.

Changed lines 69-71 from:

http:// computerfixpro.com/transmission242p.zip 06/05/2012 v2.52 r13304

to:

http:// computerfixpro.com/transmission273p.zip 12/27/2012 v2.73+ r13646

Changed lines 75-76 from:

ipkg install transmission_2.42+-1_armeb.ipk

to:

ipkg install transmission_2.73+-1_armeb.ipk

or

ipkg install transmission_2.73+-1_armeb-pcTMP.ipk

June 06, 2012, at 02:17 PM by SRS -- v2.52+ with security patches included
Changed lines 54-71 from:

01/06/2012

below is fix for:

optware feed for Transmission 2.42 is NOT compiled with µTP enabled

(plus several other v2.42 bugs)

due to compile problems as evidenced by:

trac.transmissionbt.com/ticket/4560

trac.transmissionbt.com/ticket/4604

...take care of using the non-buggy version of autoconf to generate the official

tarball - the bug would affect all users cross-compiling transmission.

to:

06/05/2012 NOW below is download for v2.52+

security patches and assorted bug fixes included

also version for temporary pieces included

both working very nicely, very stable.

use the regular or the piece-temp, whatever you prefer

reference: http:// trac.transmissionbt.com/ticket/532#comment:148

http:// computerfixpro.com/transmission242p.zip 06/05/2012 v2.52 r13304

to install:

ipkg install transmission_2.42+-1_armeb.ipk

be SURE to include the .ipk else ipkg install will try to download it

you may need to:

ipkg remove transmission if there is a version conflict

Changed lines 84-115 from:

trac.transmissionbt.com/changeset/12954/trunk/configure.ac

also note:

https://trac.transmissionbt.com/ticket/4528

difficulties with compile fixed so here is transmission_2.42+-1_armeb.ipk

http:// computerfixpro.com/transmission242p.zip 01/06/2012 v2.42+(r13123) plus #4687

to install:

ipkg install transmission_2.42+-1_armeb.ipk

be SURE to include the .ipk else ipkg install will try to download it

you may need to:

ipkg remove transmission if there is a version conflict

.

to:
January 07, 2012, at 01:10 AM by SRS -- v2.42+(r13123) plus #4687
Changed lines 54-55 from:

11/19/2011

to:

01/06/2012

January 07, 2012, at 12:58 AM by SRS -- v2.42+(r13123) plus #4687
Changed lines 86-90 from:

http:// computerfixpro.com/transmission242p.zip 12/23/2011 v2.42+(r13113) bug fixes and some nice enhancements!

to:

http:// computerfixpro.com/transmission242p.zip 01/06/2012 v2.42+(r13123) plus #4687

December 24, 2011, at 02:13 AM by SRS -- v2.42+(r13113) bug fixes and some nice enhancements!
Changed lines 86-90 from:

http:// computerfixpro.com/transmission242p.zip 12/14/2011 v2.42+(r13112) bug fixes and some nice enhancements!

to:

http:// computerfixpro.com/transmission242p.zip 12/23/2011 v2.42+(r13113) bug fixes and some nice enhancements!

December 14, 2011, at 10:44 PM by SRS -- v2.42+(r13112) bug fixes and some nice enhancements!
Changed lines 86-90 from:

http:// computerfixpro.com/transmission242p.zip

http:// computerfixpro.com/trs42pwebclientfx.zip -- minor Web UI fixes 11/11/2011

to:

http:// computerfixpro.com/transmission242p.zip 12/14/2011 v2.42+(r13112) bug fixes and some nice enhancements!

November 21, 2011, at 07:34 PM by SRS -- fix for: optware feed for Transmission 2.42 is NOT compiled with µTP enabled
Changed lines 54-62 from:

optware feed for Transmission 2.42+ not occurring perhaps compile problems:

https://trac.transmissionbt.com/changeset/12954/trunk/configure.ac

and

to:

11/19/2011

below is fix for:

optware feed for Transmission 2.42 is NOT compiled with µTP enabled

(plus several other v2.42 bugs)

due to compile problems as evidenced by:

trac.transmissionbt.com/ticket/4560

trac.transmissionbt.com/ticket/4604

...take care of using the non-buggy version of autoconf to generate the official

tarball - the bug would affect all users cross-compiling transmission.

.

trac.transmissionbt.com/changeset/12954/trunk/configure.ac

also note:

November 11, 2011, at 06:28 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-73 from:

http:// computerfixpro.com/trs42pwebclientfx.zip -- minor Web UI fixes

to:

http:// computerfixpro.com/trs42pwebclientfx.zip -- minor Web UI fixes 11/11/2011

November 11, 2011, at 06:25 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-76 from:

http:// computerfixpro.com/trs42pwebclientfx.zip

-- minor Web UI fixes

to:

http:// computerfixpro.com/trs42pwebclientfx.zip -- minor Web UI fixes

November 11, 2011, at 06:23 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 73-74 from:

http:// computerfixpro.com/WebClientFX?.zip

to:

http:// computerfixpro.com/trs42pwebclientfx.zip

November 11, 2011, at 06:20 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:

http:// computerfixpro.com/WBuiFIXES?.zip -- minor Web UI fixes

to:

http:// computerfixpro.com/WebClientFX?.zip

-- minor Web UI fixes

November 11, 2011, at 06:17 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:

http:// computerfixpro.com/WbUI?-FIXES.zip -- minor Web UI fixes

to:

http:// computerfixpro.com/WBuiFIXES?.zip -- minor Web UI fixes

November 11, 2011, at 06:13 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:

http:// computerfixpro.com/WebUI?-FIXES.zip -- minor Web UI fixes

to:

http:// computerfixpro.com/WbUI?-FIXES.zip -- minor Web UI fixes

November 11, 2011, at 06:11 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:

http:// computerfixpro.com/WebClient?-FIXES.zip -- minor Web UI fixes

to:

http:// computerfixpro.com/WebUI?-FIXES.zip -- minor Web UI fixes

November 11, 2011, at 06:06 PM by SRS -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Added lines 71-72:

http:// computerfixpro.com/WebClient?-FIXES.zip -- minor Web UI fixes

November 02, 2011, at 06:53 PM by SRS -- ipkg install Transmission 2.42+ & GUI
Added lines 98-114:

Here is a very very nice Graphical User Interface for transmission 2.42+

http:// computerfixpro.com/WIN_GUI.zip (Windows ONLY)

that supports the download queue and status, filter torrents with errors,

graphing, etc. many nice things. Give credit to Ivanal:

http:// code.google.com/p/transmisson-remote-gui/issues/detail?id=463

who worked hard to produce a fantastic update to:

http:// code.google.com/p/transmisson-remote-gui/ (MAC, LINUX, WIN)

.

October 31, 2011, at 08:43 PM by SRS -- ipkg install Transmission 2.42+
Changed lines 74-75 from:

ipkg install transmission-2.42-1_armeb.ipk

to:

ipkg install transmission_2.42+-1_armeb.ipk

October 31, 2011, at 07:37 PM by SRS -- ipkg install Transmission 2.42+
Changed lines 57-59 from:

https:// trac.transmissionbt.com/changeset/12954/trunk/configure.ac

to:

https://trac.transmissionbt.com/changeset/12954/trunk/configure.ac

Changed lines 63-65 from:

https:// trac.transmissionbt.com/ticket/4528

to:

https://trac.transmissionbt.com/ticket/4528

October 31, 2011, at 07:35 PM by SRS -- ipkg install Transmission 2.42+
Changed line 38 from:

8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

to:

8) connect to web UI http:// YOUR-NAS-IP-ADDRESS:9091/

Added lines 50-97:

.

Transmission 2.42+

optware feed for Transmission 2.42+ not occurring perhaps compile problems:

https:// trac.transmissionbt.com/changeset/12954/trunk/configure.ac

and

https:// trac.transmissionbt.com/ticket/4528

difficulties with compile fixed so here is transmission_2.42+-1_armeb.ipk

http:// computerfixpro.com/transmission242p.zip

to install:

ipkg install transmission-2.42-1_armeb.ipk

be SURE to include the .ipk else ipkg install will try to download it

you may need to:

ipkg remove transmission if there is a version conflict

.

dont forget:

Package: transmission

Version: 2.42+-1

Depends: openssl, libcurl, libevent, zlib

.

Changed lines 118-119 from:

See http://trac.transmissionbt.com/ticket/2858

to:

See http:// trac.transmissionbt.com/ticket/2858

Changed lines 126-128 from:

http://computerfixpro.com/Transmission-176-NSLU2.zip

to:

http:// computerfixpro.com/Transmission-176-NSLU2.zip

Changed line 198 from:
  • ( See http://trac.transmissionbt.com/ticket/1583 )
to:
  • ( See http:// trac.transmissionbt.com/ticket/1583 )
Changed lines 225-226 from:

<a href=\"http://slug:8081/transmission/web\">Transmission</a>"

to:

<a href=\"http:// slug:8081/transmission/web\">Transmission</a>"

Changed line 262 from:

wget -q http://www.bluetack.co.uk/config/level1.gz

to:

wget -q http:// www.bluetack.co.uk/config/level1.gz

Changed lines 276-277 from:

Clutch interface can be found at: http://<YOUR_NAS_IP>:9091/transmission/web/index.html

to:

Clutch interface can be found at: http:// <YOUR_NAS_IP>:9091/transmission/web/index.html

Changed lines 280-281 from:

See also http://trac.transmissionbt.com/wiki/Headless%20Transmisison

to:

See also http:// trac.transmissionbt.com/wiki/Headless%20Transmisison

Changed lines 350-352 from:

Wiki: http://wiki.openwrt.org/SambaHowto?highlight=%28samba%29

to:

Wiki: http:// wiki.openwrt.org/SambaHowto??highlight=%28samba%29

Changed lines 421-422 from:

http://img79.imageshack.us/img79/1609/xwrtfirewalllz5.png

to:

http:// img79.imageshack.us/img79/1609/xwrtfirewalllz5.png

Changed lines 429-430 from:

http://img176.imageshack.us/img176/5545/xwrtsyslogmv7.png

to:

http://i mg176.imageshack.us/img176/5545/xwrtsyslogmv7.png

Changed line 662 from:

Open your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:

to:

Open your browser to http:// 192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:

Changed lines 729-730 from:

http://192.168.1.1:8008/cgi-bin/transmission.cgi

to:

http:// 192.168.1.1:8008/cgi-bin/transmission.cgi

Changed line 744 from:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the directory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

to:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the directory cgi-bin). You can call the webinterface in your webbrowser by something like: http:// 192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

October 29, 2011, at 02:32 AM by SRS -- Native compile/build Transmission
Added lines 50-55:

Native compile/build Transmission

http://www.nslu2-linux.org/wiki/HowTo/TransmissionCompileBuild

April 30, 2011, at 12:14 AM by SRS -- Version 2.22-2 is fully functional
Added lines 52-61:

Version 2.22-2 is fully functional

Due to the hard work of a couple of people. They deserve a hard earned THANKS from everyone...

_______________________________________________________________________ _______________________________________________________________________ _______________________________________________________________________

July 04, 2010, at 01:02 PM by Rai -- Still broken in version 2.0x
Changed lines 50-51 from:

Version 1.8x

to:

Version 1.8x and above

Changed lines 65-67 from:
to:

Note: Version 2.0x is currently (July 2010) in optware, but is still broken.

February 09, 2010, at 12:35 AM by SRS -- Version 1.8x broken, revert to 1.76
Added lines 50-65:

Version 1.8x

Versions 1.8x seems to be broken for many.

See http://trac.transmissionbt.com/ticket/2858

as well as other major problems reported for ARM and .ipk

Revert back to version 1.76 which works excellent.

Get version 1.76 for NSLU2 here:

http://computerfixpro.com/Transmission-176-NSLU2.zip

August 02, 2009, at 05:26 PM by SRS -- Version 1.73-1 NOTES
Changed lines 62-63 from:

' umask: Number (default = 022) Set transmission's file mode creation mask. See { the umask(2) manpage} for more information. Users who want their saved torrents to be world-writable may want to set this value to 0. '

to:

' umask: Number (default = 022) Set transmission's file mode creation mask.

See { the umask(2) manpage} for more information. Users who want their

saved torrents to be world-writable may want to set this value to 0. '

Changed lines 72-73 from:
to:

__________

August 02, 2009, at 05:20 PM by SRS -- Version 1.73-1 NOTES
Added lines 50-86:

Version 1.73-1 NOTES

August 2, 2009 SRS

umask support was added in v1.73. You may change its value in the

/root/.config/transmission-daemon/settings.json file:

it is set as "umask": 18, this is decimal 18 or octal 022, which is

the most commonly used value. From the documentation:

' umask: Number (default = 022) Set transmission's file mode creation mask. See { the umask(2) manpage} for more information. Users who want their saved torrents to be world-writable may want to set this value to 0. '

Note: The client must be closed before making changes to settings.json,

otherwise settings will be reverted to it's previous state.

A lot of people are asking why Transmisson "freezes" when it starts

downloading a torrent.

This is usually because "preallocation": 2, is the value in settings.json.

From the documentation:

' * preallocation: Number (0 = Off, 1 = Fast, 2 = Full (slower but reduces disk fragmentation), default = 1) '

I keep the default setting of 2 which is very slow, but sometimes

use a value of 1 which is fast and seems to work fine.

June 07, 2009, at 05:21 PM by SRS -- version 1.70 notes
Added lines 50-70:

Version 1.70-2 NOTES

June, 7, 2009 SRS

For private trackers you should disable the new Distributed hash table (DHT) support.

When Using transmission-daemon Web GUI this is ENABLED by default!

This can only be disabled by editing the settings.json file.

Use 'vi' to edit:

vi /root/.config/transmission-daemon/settings.json

change line to: "dht-enabled": false,

You may want to disable this for public trackers in many cases also.

Version 1.70 seems to work very nicely and fixes several irritations/bugs of version 1.61.

February 13, 2009, at 06:43 AM by BrianZhou -- Moved quick start guide section up
Changed lines 24-49 from:
to:

Quick start guide

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI.

1) setup optware ipkg
2) # ipkg update
3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too)
6) $ mkdir -p $HOME/Downloads
7) $ /opt/bin/transmission-daemon -w $HOME/Downloads
   $ pidof transmission-daemon  # should return 3 process ID's
8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung? 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.

Changed lines 110-111 from:

Version >= 1.3x

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI.

to:

Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

Deleted lines 113-139:

1) setup optware ipkg 2) # ipkg update 3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too) 6) $ mkdir -p $HOME/Downloads 7) $ /opt/bin/transmission-daemon -w $HOME/Downloads

   $ pidof transmission-daemon  # should return 3 process ID's

8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/ @] The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.


Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon: [@

February 07, 2009, at 08:44 AM by axm -- formatting (linebreaks)
Changed line 52 from:
  1. !/bin/sh\\
to:

#!/bin/sh\\

February 07, 2009, at 08:42 AM by axm --
Added lines 52-114:
  1. !/bin/sh
    action=$1
    LINKS="<a href=\"transmission-manager.cgi?start\">Start</a><br/>
    <a href=\"transmission-manager.cgi?stop\">Stop</a><br/>
    <a href=\"http://slug:8081/transmission/web\">Transmission</a>"

case $action in
start)
/etc/init.d/S88transmission > /dev/null
SUCCESS=$?
BODY="Starting: $SUCCESS (0=ok)<br/>$LINKS"
;;
stop)
/etc/init.d/K88transmission > /dev/null
SUCCESS=$?
BODY="Stopping: $SUCCESS (0=ok)<br/>$LINKS"
;;
*)
BODY="$LINKS"
;;
esac
echo "Content-type: text/html"
echo
echo "<html>"
echo "<head><title>transmission manager</title></head>"
echo "<body>"
echo "<body>"
echo "$BODY"
echo "</body>"
echo "</html>"

Version >= 1.3x

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI.

1) setup optware ipkg
2) # ipkg update
3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too)
6) $ mkdir -p $HOME/Downloads
7) $ /opt/bin/transmission-daemon -w $HOME/Downloads
   $ pidof transmission-daemon  # should return 3 process ID's
8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.


Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon: [@

Changed lines 116-161 from:

action=$1 LINKS="<a href=\"transmission-manager.cgi?start\">Start</a><br/> <a href=\"transmission-manager.cgi?stop\">Stop</a><br/> <a href=\"http://slug:8081/transmission/web\">Transmission</a>"

case $action in

  start)
        /etc/init.d/S88transmission > /dev/null
        SUCCESS=$?
        BODY="Starting: $SUCCESS (0=ok)<br/>$LINKS"
        ;;
  stop)
        /etc/init.d/K88transmission > /dev/null
        SUCCESS=$?
        BODY="Stopping: $SUCCESS (0=ok)<br/>$LINKS"
        ;;
  *)
        BODY="$LINKS"
        ;;

esac

echo "Content-type: text/html" echo echo "<html>" echo "<head><title>transmission manager</title></head>" echo "<body>" echo "<body>" echo "$BODY" echo "</body>" echo "</html>"

Version >= 1.3x

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI. [@ 1) setup optware ipkg 2) # ipkg update 3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too) 6) $ mkdir -p $HOME/Downloads 7) $ /opt/bin/transmission-daemon -w $HOME/Downloads

   $ pidof transmission-daemon  # should return 3 process ID's

8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

to:
  1. update blocklist

cd /root/.config/transmission-daemon/blocklists wget -q http://www.bluetack.co.uk/config/level1.gz if test -f level1.gz; then

   rm level1
   gunzip level1.gz
   chmod go+r level1

fi

if [ -n "`pidof transmission-daemon`" ]; then

   kill -9 `pidof transmission-daemon`

fi

/opt/bin/transmission-daemon -b

Changed lines 132-164 from:

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.


Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

#!/bin/sh

# update blocklist
cd /root/.config/transmission-daemon/blocklists
wget -q http://www.bluetack.co.uk/config/level1.gz
if test -f level1.gz; then
   rm level1
   gunzip level1.gz
   chmod go+r level1
fi

if [ -n "`pidof transmission-daemon`" ]; then
   kill -9 `pidof transmission-daemon`
fi

/opt/bin/transmission-daemon -b
to:
February 07, 2009, at 08:39 AM by axm -- start-stop-cgi formatting
Deleted lines 51-113:
  • #!/bin/sh
  • action=$1
  • LINKS="<a href=\"transmission-manager.cgi?start\">Start</a><br/>
  • <a href=\"transmission-manager.cgi?stop\">Stop</a><br/>
  • <a href=\"http://slug:8081/transmission/web\">Transmission</a>"
  • case $action in
  • start)
  • /etc/init.d/S88transmission > /dev/null
  • SUCCESS=$?
  • BODY="Starting: $SUCCESS (0=ok)<br/>$LINKS"
  • ;;
  • stop)
  • /etc/init.d/K88transmission > /dev/null
  • SUCCESS=$?
  • BODY="Stopping: $SUCCESS (0=ok)<br/>$LINKS"
  • ;;
  • *)
  • BODY="$LINKS"
  • ;;
  • esac
  • echo "Content-type: text/html"
  • echo
  • echo "<html>"
  • echo "<head><title>transmission manager</title></head>"
  • echo "<body>"
  • echo "<body>"
  • echo "$BODY"
  • echo "</body>"
  • echo "</html>"

Version >= 1.3x

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI.

1) setup optware ipkg
2) # ipkg update
3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too)
6) $ mkdir -p $HOME/Downloads
7) $ /opt/bin/transmission-daemon -w $HOME/Downloads
   $ pidof transmission-daemon  # should return 3 process ID's
8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.


Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon: [@

Changed lines 53-67 from:
  1. update blocklist

cd /root/.config/transmission-daemon/blocklists wget -q http://www.bluetack.co.uk/config/level1.gz if test -f level1.gz; then

   rm level1
   gunzip level1.gz
   chmod go+r level1

fi

if [ -n "`pidof transmission-daemon`" ]; then

   kill -9 `pidof transmission-daemon`

fi

/opt/bin/transmission-daemon -b

to:

action=$1 LINKS="<a href=\"transmission-manager.cgi?start\">Start</a><br/> <a href=\"transmission-manager.cgi?stop\">Stop</a><br/> <a href=\"http://slug:8081/transmission/web\">Transmission</a>"

case $action in

  start)
        /etc/init.d/S88transmission > /dev/null
        SUCCESS=$?
        BODY="Starting: $SUCCESS (0=ok)<br/>$LINKS"
        ;;
  stop)
        /etc/init.d/K88transmission > /dev/null
        SUCCESS=$?
        BODY="Stopping: $SUCCESS (0=ok)<br/>$LINKS"
        ;;
  *)
        BODY="$LINKS"
        ;;

esac

echo "Content-type: text/html" echo echo "<html>" echo "<head><title>transmission manager</title></head>" echo "<body>" echo "<body>" echo "$BODY" echo "</body>" echo "</html>"

Version >= 1.3x

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI. [@ 1) setup optware ipkg 2) # ipkg update 3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too) 6) $ mkdir -p $HOME/Downloads 7) $ /opt/bin/transmission-daemon -w $HOME/Downloads

   $ pidof transmission-daemon  # should return 3 process ID's

8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

Changed lines 100-132 from:
to:

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

7.1) # killall transmission-daemon
7.2) # /opt/bin/transmission-daemon -h
7.3) # /opt/bin/transmission-daemon -f

NOTE: With UnSlung 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.


Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

#!/bin/sh

# update blocklist
cd /root/.config/transmission-daemon/blocklists
wget -q http://www.bluetack.co.uk/config/level1.gz
if test -f level1.gz; then
   rm level1
   gunzip level1.gz
   chmod go+r level1
fi

if [ -n "`pidof transmission-daemon`" ]; then
   kill -9 `pidof transmission-daemon`
fi

/opt/bin/transmission-daemon -b
February 07, 2009, at 08:37 AM by axm --
Added lines 50-84:
  • In my case, streaming videos over smb does not work flawlessly with transmission running. As a workaround, I put a naive cgi in the httpd/html folder to be able to start/stop it conveniently. Might as well share, if anyone is interested.
  • #!/bin/sh
  • action=$1
  • LINKS="<a href=\"transmission-manager.cgi?start\">Start</a><br/>
  • <a href=\"transmission-manager.cgi?stop\">Stop</a><br/>
  • <a href=\"http://slug:8081/transmission/web\">Transmission</a>"
  • case $action in
  • start)
  • /etc/init.d/S88transmission > /dev/null
  • SUCCESS=$?
  • BODY="Starting: $SUCCESS (0=ok)<br/>$LINKS"
  • ;;
  • stop)
  • /etc/init.d/K88transmission > /dev/null
  • SUCCESS=$?
  • BODY="Stopping: $SUCCESS (0=ok)<br/>$LINKS"
  • ;;
  • *)
  • BODY="$LINKS"
  • ;;
  • esac
  • echo "Content-type: text/html"
  • echo
  • echo "<html>"
  • echo "<head><title>transmission manager</title></head>"
  • echo "<body>"
  • echo "<body>"
  • echo "$BODY"
  • echo "</body>"
  • echo "</html>"
February 07, 2009, at 08:29 AM by axm -- random ports without -p
Changed lines 47-49 from:
to:
  • The port of the web interface is configurable with the -p option (example: -p 8081). Without it, the port seems to be random.
January 30, 2009, at 07:05 PM by fmt -- format
Changed lines 27-48 from:

With version 1.42 functionality for an IP address whitelist became active for the WebGUI?. ( See http://trac.transmissionbt.com/ticket/1583 ) So you MUST specify the "rpc-whitelist" setting in the settings.json file. You can do so by editing settings.json directly or using the -a option when starting transmission-daemon:

-a --allowed x.x.x.x,...

             Allow RPC accecss to a comma-delimited whitelist

of IP addresses. Wildcards can be specified in an address by using '*'. Default: "127.0.0.1" Example: "127.0.0.*,192.168.1.*"

The option sticks in future starts of transmission-daemon. A value of *.*.*.* allows all IP addresses.

Also note the rpc-whitelist-enabled key is NON functional for the clutch WebGUI?

Quickstart guide for Version >= 1.3x

to:
  • With version 1.42 functionality for an IP address
  • whitelist became active for the WebGUI?.
  • ( See http://trac.transmissionbt.com/ticket/1583 )
  • So you MUST specify the "rpc-whitelist" setting in the
  • settings.json file. You can do so by editing settings.json
  • directly or using the -a option when starting
  • transmission-daemon:
  • -a --allowed x.x.x.x,...
  • Allow RPC accecss to a comma-delimited whitelist
  • of IP addresses. Wildcards can be specified
  • in an address by using '*'.
  • Default: "127.0.0.1" Example: "127.0.0.*,192.168.1.*"
  • The option sticks in future starts of transmission-daemon.
  • A value of *.*.*.* allows all IP addresses.
  • Also note the rpc-whitelist-enabled key is NON functional
  • for the clutch WebGUI?

Version >= 1.3x

January 22, 2009, at 11:23 PM by BrianZhou -- formatting
Changed lines 27-48 from:
  • With version 1.42 functionality for an IP address
  • whitelist became active for the WebGUI?.
  • ( See http://trac.transmissionbt.com/ticket/1583 )
  • So you MUST specify the "rpc-whitelist" setting in the
  • settings.json file. You can do so by editing settings.json
  • directly or using the -a option when starting
  • transmission-daemon:
  • -a --allowed x.x.x.x,...
  • Allow RPC accecss to a comma-delimited whitelist
  • of IP addresses. Wildcards can be specified
  • in an address by using '*'.
  • Default: "127.0.0.1" Example: "127.0.0.*,192.168.1.*"
  • The option sticks in future starts of transmission-daemon.
  • A value of *.*.*.* allows all IP addresses.
  • Also note the rpc-whitelist-enabled key is NON functional
  • for the clutch WebGUI?

Version >= 1.3x

to:

With version 1.42 functionality for an IP address whitelist became active for the WebGUI?. ( See http://trac.transmissionbt.com/ticket/1583 ) So you MUST specify the "rpc-whitelist" setting in the settings.json file. You can do so by editing settings.json directly or using the -a option when starting transmission-daemon:

-a --allowed x.x.x.x,...

             Allow RPC accecss to a comma-delimited whitelist

of IP addresses. Wildcards can be specified in an address by using '*'. Default: "127.0.0.1" Example: "127.0.0.*,192.168.1.*"

The option sticks in future starts of transmission-daemon. A value of *.*.*.* allows all IP addresses.

Also note the rpc-whitelist-enabled key is NON functional for the clutch WebGUI?

Quickstart guide for Version >= 1.3x

January 03, 2009, at 04:47 PM by SRS -- version 1.42-1 settings notes
Changed lines 44-47 from:
to:
  • Also note the rpc-whitelist-enabled key is NON functional
  • for the clutch WebGUI?
January 03, 2009, at 04:38 PM by SRS -- version 1.42-1 notes
Added lines 24-44:

Version 1.42-1 NOTES

  • With version 1.42 functionality for an IP address
  • whitelist became active for the WebGUI?.
  • ( See http://trac.transmissionbt.com/ticket/1583 )
  • So you MUST specify the "rpc-whitelist" setting in the
  • settings.json file. You can do so by editing settings.json
  • directly or using the -a option when starting
  • transmission-daemon:
  • -a --allowed x.x.x.x,...
  • Allow RPC accecss to a comma-delimited whitelist
  • of IP addresses. Wildcards can be specified
  • in an address by using '*'.
  • Default: "127.0.0.1" Example: "127.0.0.*,192.168.1.*"
  • The option sticks in future starts of transmission-daemon.
  • A value of *.*.*.* allows all IP addresses.
December 04, 2008, at 09:04 PM by Michael -- question added
Changed lines 1348-1351 from:
  • With Transmission 1.4 I could download a 700 MB torrent with no problems. But trying a

30 GiB? torrent, it crashes my NSLU2 every time. No Clutch, no telnet access, no Unslung (6.8) web UI -- but for some reason, it still responds to ping requests over the network.

 What could be wrong? Swap space is 128 MB. //Michael
to:
  • With Transmission 1.4 I could download a 700 MB torrent with no problems. But trying a 30 GiB? torrent, it crashes my NSLU2 every time. No Clutch, no telnet access, no Unslung (6.8) web UI -- but for some reason, it still responds to ping requests over the network. What could be wrong? Swap space is 128 MB. //Michael
December 04, 2008, at 09:03 PM by Michael -- question added
Changed lines 1348-1351 from:
  • With Transmission 1.4 I could download a 700 MB torrent with no problems. But trying a 30 GiB? torrent, it crashes my NSLU2 every time. No Clutch, no telnet access, no Unslung (6.8) web UI -- but for some reason, it still responds to ping requests over the network. What could be wrong? Swap space is 128 MB. //Michael
to:
  • With Transmission 1.4 I could download a 700 MB torrent with no problems. But trying a

30 GiB? torrent, it crashes my NSLU2 every time. No Clutch, no telnet access, no Unslung (6.8) web UI -- but for some reason, it still responds to ping requests over the network.

 What could be wrong? Swap space is 128 MB. //Michael
December 04, 2008, at 09:00 PM by Michael -- question added
Changed lines 1347-1348 from:
  • Thank you for helping me. Problem solved. I have had a torrent file in Transmission that I've used for testing. Apparently, I had to remove it and add it again for Transmission to check the settings file. //John
to:
  • Thank you for helping me. Problem solved. I have had a torrent file in Transmission that I've used for testing. Apparently, I had to remove it and add it again for Transmission to check the settings file. //John
  • With Transmission 1.4 I could download a 700 MB torrent with no problems. But trying a 30 GiB? torrent, it crashes my NSLU2 every time. No Clutch, no telnet access, no Unslung (6.8) web UI -- but for some reason, it still responds to ping requests over the network. What could be wrong? Swap space is 128 MB. //Michael
November 22, 2008, at 03:02 PM by SRS -- clarify
Changed lines 45-47 from:

NOTE: With UnSlung? 6.x and Transmission 1.4 it was ...transmission-da (NOT transmission-daemon). Using 'ps -A' or 'ps' command you will see this.

to:

NOTE: With UnSlung? 6.x and Transmission 1.4 it was 'killall transmission-da' (NOT 'killall transmission-daemon'). Using 'ps -A' or 'ps' command you will see this.

November 22, 2008, at 02:54 PM by SRS -- syntax
Changed lines 45-47 from:

NOTE: With UnSlung? 6.x and Transmission 1.4 it was ...transmission-da (NOT transmission-daemon). Using 'ps -A' command you will see this.

to:

NOTE: With UnSlung? 6.x and Transmission 1.4 it was ...transmission-da (NOT transmission-daemon). Using 'ps -A' or 'ps' command you will see this.

November 22, 2008, at 02:50 PM by SRS -- install notes
Added lines 44-47:

NOTE: With UnSlung? 6.x and Transmission 1.4 it was ...transmission-da (NOT transmission-daemon). Using 'ps -A' command you will see this.

November 13, 2008, at 09:46 PM by BrianZhou -- 1.40
Changed line 24 from:

Version 1.3x

to:

Version >= 1.3x

Changed line 37 from:

8) connect to web UI http://NAS:9091/

to:

8) connect to web UI http://YOUR-NAS-IP-ADDRESS:9091/

Deleted line 38:
  • caps count*
October 24, 2008, at 05:37 PM by arthur92710 --
Changed line 39 from:
to:
  • caps count*
October 22, 2008, at 05:39 PM by Snake98 --
Changed line 75 from:

DD-WRT USER

to:

DD-WRT USER

Changed lines 81-83 from:
to:
   Also, use ext2,ext3.  Fat/fat32 will have problems with torrents over 5 gigs(not a file size issue,2gig limit) but just reads and writes, it locks up the router, and can corrupt files.
October 22, 2008, at 05:36 PM by Snake98 --
Added lines 75-81:

DD-WRT USER

  You will need to change the following

   Your crontab file is
     */30 * * * * root /opt/bin/nice /opt/sbin/transmission_watchdog
Changed lines 1294-1295 from:

Name a Torrent as you download it

to:

Name a Torrent as you download it-- this is included with transmission 1.3x and up

October 14, 2008, at 05:31 PM by Brad -- Questions on 1.3x
Added lines 75-78:

Questions & Answer on 1.3x

  • Is there a way to use blocklist with the transmissiond (cgi interface)?
September 24, 2008, at 05:48 PM by BrianZhou -- verify transmission-daemon started
Added line 36:
   $ pidof transmission-daemon  # should return 3 process ID's
Deleted line 37:

9) usage of the web UI should be straight-forward.

Changed line 40 from:

The above should get you started. If you have any problem on step 7

to:

The above should get you started, usage of the web UI should be straight-forward. If you have any problem starting transmission-daemon on step 7

September 24, 2008, at 05:43 PM by BrianZhou -- formatting
Changed line 26 from:
to:

[@

Changed lines 38-39 from:
to:

@]

Added line 41:

[@

Changed lines 45-46 from:
to:

@]

September 24, 2008, at 05:42 PM by BrianZhou -- Simple instruction
Changed lines 25-46 from:

avgjoe - New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions that follow this are now invalid. Transmission 1.3x comes with Clutch. Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

to:

New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions below the dividing line are now invalid. Transmission 1.3x comes with Clutch Web UI.

1) setup optware ipkg 2) # ipkg update 3) # ipkg install transmission

4) forward port 51413 to NAS

5) (recommend to create and login as a non-root user, root user might work too) 6) $ mkdir -p $HOME/Downloads 7) $ /opt/bin/transmission-daemon -w $HOME/Downloads 8) connect to web UI http://NAS:9091/ 9) usage of the web UI should be straight-forward.

The above should get you started. If you have any problem on step 7 7.1) # killall transmission-daemon 7.2) # /opt/bin/transmission-daemon -h 7.3) # /opt/bin/transmission-daemon -f

Autostart

avgjoe - Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

Changed lines 68-69 from:

You can modify the Clutch config editing this file /root/.config/transmission-daemon/settings.json

to:

You can modify config either using web UI, or by editing /root/.config/transmission-daemon/settings.json

See also http://trac.transmissionbt.com/wiki/Headless%20Transmisison


September 05, 2008, at 09:30 AM by John --
Changed line 1304 from:
  • Thank you for helping me. Tried doing that but it didnt solve my problem. Any other suggestions? //John
to:
  • Thank you for helping me. Problem solved. I have had a torrent file in Transmission that I've used for testing. Apparently, I had to remove it and add it again for Transmission to check the settings file. //John
September 05, 2008, at 09:03 AM by John --
Changed line 1299 from:
  • I keep getting an error when I try to download through Transmission. "Destination folder doesn't exist", even though my folders do exist. Most of all, id like Transmission to save my torrents to /share/hdd/data/public/Torrents (because I know where to find that folder! =D)
to:
  • I keep getting an error when I try to download through Transmission. "Destination folder doesn't exist", even though my folders do exist. Most of all, id like Transmission to save my torrents to /share/hdd/data/public/Torrents (because I know where to find that folder! =D) //John
Changed lines 1303-1304 from:

@]

to:

@]

  • Thank you for helping me. Tried doing that but it didnt solve my problem. Any other suggestions? //John
September 03, 2008, at 07:37 PM by avgjoe -- attempt to answer question
Added lines 1300-1303:
  • Have you edited your /root/.config/transmission-daemon/settings.json file? This is assuming you are running the daemon as root of course. Your setting for download dir should be as follows:
"download-dir": "\/share\/hdd\/data\/public\/Torrents",
September 03, 2008, at 09:00 AM by John --
Changed line 1299 from:
  • I keep getting an error when I try to download through Transmission. "Destination folder doesn't exist", even though my folders do exist. Most of all, id like Transmission to save my torrents to /share/hdd/data/public/Torrents (because I know where to find that folder! =D)
to:
  • I keep getting an error when I try to download through Transmission. "Destination folder doesn't exist", even though my folders do exist. Most of all, id like Transmission to save my torrents to /share/hdd/data/public/Torrents (because I know where to find that folder! =D)
September 03, 2008, at 08:59 AM by John -- added question
Added line 1299:
  • I keep getting an error when I try to download through Transmission. "Destination folder doesn't exist", even though my folders do exist. Most of all, id like Transmission to save my torrents to /share/hdd/data/public/Torrents (because I know where to find that folder! =D)
August 17, 2008, at 06:56 PM by DarkGafarro -- Transmission info
Changed lines 11-12 from:
  • WWW interface transmission.cgi can be public (no password) as there is no delete provided.
to:
  • WWW interface transmission.cgi can be public (no password) as there is no delete provided. (old versions)
  • Clutch WWW Interface with username and password. (for versions > 1.31)
Changed lines 47-48 from:

DarkGafarro? - You can modify the Clutch confif editing this file /root/.config/transmission-daemon/settings.json

to:

You can modify the Clutch config editing this file /root/.config/transmission-daemon/settings.json

August 17, 2008, at 06:52 PM by DarkGafarro -- modify clutch config
Added lines 46-47:

DarkGafarro? - You can modify the Clutch confif editing this file /root/.config/transmission-daemon/settings.json

August 14, 2008, at 09:20 PM by avgjoe --
Added lines 44-45:

Clutch interface can be found at: http://<YOUR_NAS_IP>:9091/transmission/web/index.html

August 14, 2008, at 09:19 PM by avgjoe -- Transmission 1.3 changes and start script suggestion
Changed lines 23-35 from:

Version 1.10

http://trac.transmissionbt.com/report/25

+ Stop torrents when downloading and the disk becomes full

+ Removing a torrent also removes it from the cache

+ Smaller memory footprint per-torrent and per-peer

+ Various backend bugfixes & improvements

avgjoe - running 1.10 right now with no issues

to:

Version 1.3x

avgjoe - New version of Transmission based on the 1.3 branch is now available via ipkg install. Most of the instructions that follow this are now invalid. Transmission 1.3x comes with Clutch. Upon successfully installing 1.3x under ipkg you must start the transmission daemon. I have created a basic start script which will fetch the new version of the blocklist from bluetack and start the transmission-daemon:

#!/bin/sh

# update blocklist
cd /root/.config/transmission-daemon/blocklists
wget -q http://www.bluetack.co.uk/config/level1.gz
if test -f level1.gz; then
   rm level1
   gunzip level1.gz
   chmod go+r level1
fi

if [ -n "`pidof transmission-daemon`" ]; then
   kill -9 `pidof transmission-daemon`
fi

/opt/bin/transmission-daemon -b
Deleted line 1293:
  • Transmission 1.20 is available. How is the blocklist being handled for the NSLU2 distribution?
August 07, 2008, at 09:15 PM by Brad --
Changed line 1257 from:

new line if [ ${#tname} >0 ] ; then

to:

new line if [ ${#tname} < 1 ] ; then

August 07, 2008, at 09:10 PM by Brad --
Added line 1254:
Changed line 1257 from:

new line if [ -n ${tname} ] ; then

to:

new line if [ ${#tname} >0 ] ; then

Added line 1262:
Added line 1266:
Added line 1271:
Added line 1275:
Added line 1279:
July 15, 2008, at 11:43 PM by Brad --
Deleted line 1249:
Changed line 1263 from:
to:

[@

Deleted line 1266:
Changed line 1268 from:
to:

@]

Changed line 1270 from:
to:

[@

Changed line 1274 from:
to:

@]

July 15, 2008, at 11:42 PM by Brad --
Changed line 1262 from:

[@

to:

@]

July 15, 2008, at 11:41 PM by Brad --
Changed line 1254 from:
to:

[@

Changed line 1262 from:
to:

[@

July 15, 2008, at 11:40 PM by Brad --
Changed lines 1257-1262 from:

new line if [ -n ${tname} ] ; then new line FILE=$(echo "${TORRENT}" |sed 's|^.*/||;s|?.*||') new line else new line FILE=$(echo "${tname}.torrent") new line fi

to:

new line if [ -n ${tname} ] ; then new line FILE=$(echo "${TORRENT}" |sed 's|^.*/||;s|?.*||') new line else new line FILE=$(echo "${tname}.torrent") new line fi

July 15, 2008, at 11:39 PM by Brad --
Deleted lines 1262-1263:
July 15, 2008, at 11:38 PM by Brad --
Deleted line 1257:
Deleted line 1258:
Deleted line 1259:
Deleted line 1260:
July 10, 2008, at 07:13 PM by Brad --
Added line 1256:
Added line 1258:
Added line 1260:
Added line 1262:
Added line 1264:
Added lines 1267-1268:
July 10, 2008, at 07:13 PM by Brad --
Deleted line 1255:
Deleted line 1256:
Deleted line 1257:
Deleted line 1258:
Deleted lines 1261-1264:
July 10, 2008, at 07:12 PM by Brad --
Deleted line 1263:
July 10, 2008, at 07:11 PM by Brad --
Changed lines 1245-1246 from:

I did this because some torrent sites use "download.torrent" as all the torrent names, this option allows you to name the torrent, so you can download more than 1 at a time, and give it a useful description

to:

I did this because some torrent sites use "download.torrent" as all the torrent names, this option allows you to name the torrent, so you can download more than 1 at a time, and give it a useful description

Added line 1258:
Added line 1260:
Added line 1262:
Added line 1264:
Added line 1270:
Added line 1276:
Changed lines 1282-1284 from:

n ew line onClick='value=prompt("Enter torrent link location for fetching");document.myform.tname.value=prompt("Enter Torrent Name")'>

to:

new line onClick='value=prompt("Enter torrent link location for fetching");document.myform.tname.value=prompt("Enter Torrent Name")'>

July 10, 2008, at 07:09 PM by Brad --
Added line 1263:
July 10, 2008, at 07:08 PM by Brad --
Added lines 1243-1275:

Name a Torrent as you download it

I did this because some torrent sites use "download.torrent" as all the torrent names, this option allows you to name the torrent, so you can download more than 1 at a time, and give it a useful description

Note, do this after everything else is working.

Change the following in transmission.cgi, there are three areas to change

edit 1(approx line 282) This take in account if you leave the prompt blank for the torrent name, it will use the default

old line FILE=$(echo "${TORRENT}" |sed 's|^.*/||;s|?.*||')

new line if [ -n ${tname} ] ; then new line FILE=$(echo "${TORRENT}" |sed 's|^.*/||;s|?.*||') new line else new line FILE=$(echo "${tname}.torrent") new line fi

edit 2 (approx line 620)this addes a hidden value and names the form so we can change it

old line <form action=transmission.cgi method=get>

new line <form action=transmission.cgi method=get name="myform"> new line <input type="hidden" name="tname" value="">

edit 3(approx line 639) Adds the second prompt to name the torrent

old line onClick='value=prompt("Enter torrent link location for fetching")'> n ew line onClick='value=prompt("Enter torrent link location for fetching");document.myform.tname.value=prompt("Enter Torrent Name")'>

June 10, 2008, at 10:35 AM by thomas -- added breaks
Changed lines 39-42 from:

source - User should copy .torrent files here work - Used for torrent processing target - Place where finished torrents are put

to:
  • source - User should copy .torrent files here
  • work - Used for torrent processing
  • target - Place where finished torrents are put
May 21, 2008, at 06:33 PM by avgjoe -- Blocklist question
Changed lines 1247-1248 from:
  • Not a developer here, but perhaps I might help. The only time I get the error message about /var/log/messages is when I haven't run the transmission daemon for a while. Once it starts logging stats into /var/log/messages, that error goes away. Just make sure that the daemon is running under a user that has read/write access to /var/log/messages I run the transmission.cgi off the standard thttpd
to:
  • Not a developer here, but perhaps I might help. The only time I get the error message about /var/log/messages is when I haven't run the transmission daemon for a while. Once it starts logging stats into /var/log/messages, that error goes away. Just make sure that the daemon is running under a user that has read/write access to /var/log/messages I run the transmission.cgi off the standard thttpd
  • Transmission 1.20 is available. How is the blocklist being handled for the NSLU2 distribution?
April 04, 2008, at 07:06 PM by avgjoe --
Added line 27:
Added line 29:
Added line 31:
April 04, 2008, at 07:06 PM by avgjoe --
Added line 25:
April 04, 2008, at 07:05 PM by avgjoe -- Added 1.10 details
Added lines 23-31:

Version 1.10

http://trac.transmissionbt.com/report/25 + Stop torrents when downloading and the disk becomes full + Removing a torrent also removes it from the cache + Smaller memory footprint per-torrent and per-peer + Various backend bugfixes & improvements

avgjoe - running 1.10 right now with no issues

March 31, 2008, at 06:39 PM by avgjoe --
Changed lines 1233-1234 from:
  • I just got an NSLU2 and installed the latest stable firmware (Unslung V2.3R63-uNSLUng-6.10-beta) -- I'm not sure if this has anything to do with it (since the instructions above say 6.8), but I can't get transmission.cgi to work; it always complays that it can't access /var/log/messages (using the included transmission.cgi, or the modified one above). I also tried the crontab & init.d/S05syslog modifications; made no difference. The only other variable (other than the Unslung version) is that I'm running it through lighttpd.
to:
  • I just got an NSLU2 and installed the latest stable firmware (Unslung V2.3R63-uNSLUng-6.10-beta) -- I'm not sure if this has anything to do with it (since the instructions above say 6.8), but I can't get transmission.cgi to work; it always complays that it can't access /var/log/messages (using the included transmission.cgi, or the modified one above). I also tried the crontab & init.d/S05syslog modifications; made no difference. The only other variable (other than the Unslung version) is that I'm running it through lighttpd.
    • Not a developer here, but perhaps I might help. The only time I get the error message about /var/log/messages is when I haven't run the transmission daemon for a while. Once it starts logging stats into /var/log/messages, that error goes away. Just make sure that the daemon is running under a user that has read/write access to /var/log/messages I run the transmission.cgi off the standard thttpd
March 28, 2008, at 11:47 PM by ralph -- New question
Changed lines 1231-1233 from:

Is there a way to enable encryption and also disable unencrypted communication? -Upgraded to Transmission 1.0.5 via ipkg and the new conf file came with encryption options. Also the transmission.cgi did not need to be edited and worked straight from the ipkg installation. -I just got an NSLU2 and installed the latest stable firmware (Unslung V2.3R63-uNSLUng-6.10-beta) -- I'm not sure if this has anything to do with it (since the instructions above say 6.8), but I can't get transmission.cgi to work; it always complays that it can't access /var/log/messages (using the included transmission.cgi, or the modified one above). I also tried the crontab & init.d/S05syslog modifications; made no difference. The only other variable (other than the Unslung version) is that I'm running it through lighttpd.

to:
  • Is there a way to enable encryption and also disable unencrypted communication?
    • Upgraded to Transmission 1.0.5 via ipkg and the new conf file came with encryption options. Also the transmission.cgi did not need to be edited and worked straight from the ipkg installation.
  • I just got an NSLU2 and installed the latest stable firmware (Unslung V2.3R63-uNSLUng-6.10-beta) -- I'm not sure if this has anything to do with it (since the instructions above say 6.8), but I can't get transmission.cgi to work; it always complays that it can't access /var/log/messages (using the included transmission.cgi, or the modified one above). I also tried the crontab & init.d/S05syslog modifications; made no difference. The only other variable (other than the Unslung version) is that I'm running it through lighttpd.
March 28, 2008, at 11:46 PM by ralph --
Changed lines 1232-1233 from:

-Upgraded to Transmission 1.0.5 via ipkg and the new conf file came with encryption options. Also the transmission.cgi did not need to be edited and worked straight from the ipkg installation.

to:

-Upgraded to Transmission 1.0.5 via ipkg and the new conf file came with encryption options. Also the transmission.cgi did not need to be edited and worked straight from the ipkg installation. -I just got an NSLU2 and installed the latest stable firmware (Unslung V2.3R63-uNSLUng-6.10-beta) -- I'm not sure if this has anything to do with it (since the instructions above say 6.8), but I can't get transmission.cgi to work; it always complays that it can't access /var/log/messages (using the included transmission.cgi, or the modified one above). I also tried the crontab & init.d/S05syslog modifications; made no difference. The only other variable (other than the Unslung version) is that I'm running it through lighttpd.

February 21, 2008, at 12:25 AM by avgjoe --
Changed lines 1231-1232 from:

Is there a way to enable encryption and also disable unencrypted communication?

to:

Is there a way to enable encryption and also disable unencrypted communication? -Upgraded to Transmission 1.0.5 via ipkg and the new conf file came with encryption options. Also the transmission.cgi did not need to be edited and worked straight from the ipkg installation.

February 07, 2008, at 07:29 PM by avgjoe --
Changed lines 1227-1231 from:

In /opt/etc/ edit the line in crontab which references to transmission_watchdog: admin must be replaced by root

to:

In /opt/etc/ edit the line in crontab which references to transmission_watchdog: admin must be replaced by root

Questions

Is there a way to enable encryption and also disable unencrypted communication?

January 31, 2008, at 07:50 AM by oleo -- uclibc-opt_0.9.28-13
Changed lines 237-238 from:
 wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
 ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk 
to:
 wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk
 ipkg.sh install uclibc-opt_0.9.28-13_mipsel.ipk 
January 20, 2008, at 10:39 AM by oleo --
Changed line 8 from:
  • Miltitracker, PEX support, UPNP support, Bandwith limiting
to:
  • Multitracker, PEX support, UPNP support, Encryption support, Bandwith limiting
September 17, 2007, at 04:08 PM by deleted --
Added lines 477-478:

[hash]!/bin/sh

September 05, 2007, at 11:07 AM by Federico --
Changed line 174 from:

One needs just add the following line to @/etc/crontabs/root@ file:

to:

One needs just add the following line to /etc/crontabs/root file:

Added lines 178-183:

To let execute on startup, just run this command:

  root@oleo:/etc/rc.d# /etc/rc.d/S50cron enable
September 02, 2007, at 06:11 PM by crebain -- Fixed a typo
Changed line 461 from:

Install notes for transmission on NLSU2? with Unslung 6.8

to:

Install notes for transmission on NSLU2 with Unslung 6.8

August 18, 2007, at 10:40 AM by marceln -- REmove false wiki words
Changed line 456 from:
  1. In the web interface disable Telnet and enable DynDNS
to:
  1. In the web interface disable Telnet and enable DynDNS
June 25, 2007, at 10:20 PM by oleo --
Changed lines 470-472 from:
to:
. /opt/etc/transmission.conf

PATH=/bin:/sbin:/usr/bin:/opt/sbin:/opt/bin:/usr/sbin
export PATH



_update_active()
{
    if [ -n "`ls ${WORK}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	ls -1  ${WORK}/*/*.torrent > ${ACTIVE}	
    else
    	rm -f ${ACTIVE}
    fi
    if [ -n "`ls ${TARGET}/*/*.seeding 2>/dev/null | head -n 1`" ] ; then
        ls -1  ${TARGET}/*/*.seeding >> ${ACTIVE}
    fi
    [ -f ${PIDFILE} ] && kill -HUP `cat ${PIDFILE}`
}
_write_info()
{
    echo "STARTTIME=\"${STARTTIME}\"
ENDTIME=\"${ENDTIME}\"
STATUS=\"${STATUS}\"
SCRAPE=\"${SCRAPE}\"
UPLOADED=\"${UPLOADED}\"
URL=\"${URL}\"
NOTE=\"${NOTE}\"
TORRENTNAME=\"${TORRENTNAME}\"" > "${TORRENT%/*}/.info"
}


_clean_info()
{
    STARTTIME=""
    ENDTIME=""
    STATUS=""
    SCRAPE=""
    TORRENTNAME=""
    UPLOADED=""
    URL=""
    NOTE=""
}


_update_progress()
{
    if [ -f ${PIDFILE} ]; then
        PID=`cat ${PIDFILE}`
        if `grep -q transmissiond /proc/${PID}/cmdline 2> /dev/null` ; then
            kill -USR1 ${PID}
            sleep 1     
            for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent.seeding
                do if [ -d "${TORRENT%/*}" ]; then
                    INFO="${TORRENT%/*}/.info"  
                    if [ -f "${INFO}" ]; then
	                . "${INFO}"
	                LOG="${TORRENT%/*}/.status"
	                if [ -f "${LOG}" ]; then
	                    .  "${LOG}"
	                else
	                    STATUS=".status not found for ${TORRENT}"
	                fi
                    else
	                _clean_info
                    fi
                    _write_info
                fi
            done
            UPLOADED=
            return      
        fi      
    else 
	echo "<p>Transmission daemon is not running.</p>"
	echo "<p>Status not updated!</p>"
    fi
}


_start_torrent()
{
    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ] ; then
	TMP="${TORRENT}"
	 . "${INFO}" 
	 TORRENT="${TMP}"
    else
	_clean_info
    fi
    [ -z "${STARTTIME}" ] && STARTTIME=`date +"${DATE_FORMAT}"`
    STATUS="started"
    UPLOADED=
    _write_info
    _update_active
}

_stop_torrent ()
{
    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f  "${INFO}"  ] ; then
	. "${INFO}"
	[ -z "${ENDTIME}" ] && ENDTIME=`date +"${DATE_FORMAT}"`
	STATUS=`echo "${STATUS}"|sed -e 's/Progress: \([0-9\.]\{2,6\} %\).*/\1/p;d'`
	_write_info
	_update_active
    fi
}



_enqueue()
{
    TORRENTNAME="${TORRENT%.torrent}"
    TORRENTNAME="${TORRENTNAME##*/}"
    mkdir -p "$WORK/$TORRENTNAME"                                               
    chmod 777 "$WORK/$TORRENTNAME" 
    mv "${TORRENT}" "$WORK/$TORRENTNAME"
    TORRENT="$WORK/$TORRENTNAME/${TORRENTNAME}.torrent"       
    _write_info
    _start_torrent "${TORRENT}"
}


_suspend ()
{
    mv "${TORRENT}" "${TORRENT}.suspended"
    _stop_torrent "${TORRENT}"
}


_resume ()
{

    mv "${TORRENT}" "${TORRENT%.suspended}"
    _start_torrent "${TORRENT%.suspended}"
}


_seed ()
{

   if [ ! -f "${TARGET}${TORRENT#${TARGET}}" ] ; then
	echo "<b>Can only seed already done torrents</b>"
	return
   fi

   if [ -f "${TORRENT%.seeding}" ]; then
	mv "${TORRENT}" "${TORRENT}.seeding"
	_start_torrent "${TORRENT}.seeding"
   else
	mv "${TORRENT}" "${TORRENT%.seeding}"
	_stop_torrent "${TORRENT%.seeding}"
   fi 
}


_purge ()
{
    LOG=`ls -1 $TARGET/*/.info 2>/dev/null | head -n 1`
    if [ -z "${LOG}" ] ; then
	echo "No .info to purge."
    else
      echo "<pre>"
      for f in $TARGET/*/.info ; do
	  DUMMY="${f%/.info}"
	  TORRENT="${DUMMY}/${DUMMY##*/}.torrent.seeding"
	  if [ -f "${TORRENT}" ]; then
		echo "<b>status $f not purged</b>"
	  else
          	echo "Puging ${DUMMY}"
		[ -f "${DUMMY}/.status" ] && rm "${DUMMY}/.status"
		. "${f}"
		STATUS=""
		_write_info
	  fi 
      done
      echo "</pre>"
    fi

    REMOVED=`ls -1 $WORK/*/*.torrent.removed 2>/dev/null | head -n 1`
    if [ -n "${REMOVED}" ]; then
        echo "<pre>"
	for f in $WORK/*/*.torrent.removed ; do
		DIR="${f%/*}"
		echo "Purging $DIR"
		rm -fr "${DIR}"			
	done
        echo "</pre>"
    fi
}


_pause ()
{
    if [ -f "$WORK/.paused" ] ; then
	rm "$WORK/.paused"

	[ -e ${PIDFILE} ] && rm ${PIDFILE}
	export HOME
	_update_active
	if  false ; then
	        echo "Starting transmission daemon ..." 
                transmissiond -p ${LISTENING_PORT} \
                ${NAT_TRAVERSAL} \
		-w ${WATCHDOG} \
		-u ${UPLOAD_SPEED} \
		-d ${DOWNLOAD_SPEED} \
		-i ${PIDFILE}   ${ACTIVE}
	    sleep 5
	    if [ -f ${PIDFILE} ]; then
		PID=`cat ${PIDFILE}`
		echo "<p>Transmission daemon started with PID=${PID}</p>"
	    else
		echo "<p><b>Transmission daemon failed to start</b></p>" 
	    fi
	else
	  echo "<p>transmission_watchdog will start Transmission daemon.</p>"
          echo "<p>Press Watchdog button to force watchdog queue processing</p>"
	fi
    else
	touch "$WORK/.paused"
	kill -TERM `cat ${PIDFILE}`
	echo "<b>Stopping transmissison!</b>"
	echo "<p>Transmission will eventually stop. "
	echo "Last Log line should report transmissiond exiting.<p>"
    fi
}


_scrape ()
{
  for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent* ; do
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ]; then
	. "${INFO}"
	SCRAPE=`transmissioncli -s "${TORRENT}" | grep seeder`
	DUMMY=$?
	_write_info
	if [ $DUMMY != 0 ]; then
	   echo "<p>${TORRENT} scrape failed</p>"
	fi
	UPLOADED=
	echo "."
    fi  
  done
  echo " done."
}


_best_seed ()                     
{                                
   BEST=0              
    if [ -n "`ls ${TARGET}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	for TORRENT in ${TARGET}/*/*.torrent ; do
	    INFO="${TORRENT%/*}/.info"
	    if [ -f "${INFO}" ]; then
		. "${INFO}"
		QUOTIENT=`echo "${SCRAPE}" | sed -n -e '/seeder/s/\([0-9]\{1,\}\) seeder(s), \([0-9]\{1,\}\) leecher.*/(\2000\/(\1+1)/p;d'` 
		RATIO=$((QUOTIENT))
		if [ ${RATIO} -gt ${BEST} ]; then
		    BESTTORRENT="${TORRENT}"
		    BESTSCRAPE="${SCRAPE}"
		    BEST=${RATIO}
		fi                                   
            fi       
	done 
	echo "<h3>Best seed suggestion</h3>"
	echo "<p>${BESTTORRENT##*/}</p>"
	echo "<p>${BESTSCRAPE}</p>"
   else                                                                
	echo "<b>No torrents to suggest for seeding</b>"
   fi                                       
}


_fetch()
{
    TORRENT=$(echo "${FETCH}" |sed 's/%/\\x/g')
    TORRENT=$(echo -e "${TORRENT}")
    echo "<p>Fetching ${TORRENT}</p>"
    wget -q -P ${SOURCE} "${TORRENT}"  ||  echo "<p>wget ${TORRENT} failed</p>"
}



__find ()
{
    [ -n "${TORRENT}" ] && return

    FILEPAT="$1"
    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ] ; then
	for i in $FILEPAT ; do
	    if [ $ID = $idx ]; then
		TORRENT="$i"

		return
	    fi
	    idx=$(($idx+1)) 
	done
    fi
}


_find ()
{
    idx=0 
    TORRENT=""
    __find "$WORK/*/*.torrent"
    __find "$TARGET/*/*.torrent.seeding"
    __find "$WORK/*/*.torrent.suspended"
    __find "$WORK/*/*.torrent.removed"
    __find "$SOURCE/*.torrent"
    __find "$TARGET/*/*.torrent" 
   [ -z "${TORRENT}" ] && echo "Assertion failed [ -z TORRENT ] in _find()" 
}

__list ()
{
    FILEPAT="$1"
    DESC="$2"

    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ]
    then
	echo "<table>"
	echo "<thead><tr><td></td><td>${DESC}</td><td>status</td></tr>"
	echo "</thead><tbody>"
	for i in $FILEPAT
	do
	    DUMMY="${i%.torrent*}"
	    P="${i%/*}"
	    DUMMY=${DUMMY##*/}
	    echo "<tr><td><input name=ID value=$idx type=radio></td>"
	    if [ -f "${P}/.info" ];then
	       . "${P}/.info" 
	    else
	       _clean_info
	    fi
	    TORRENT="$i"
	    if [ -n "${SETURL}" -a "${idx}" = "${ID}" ]; then
	       URL=$(echo "${SETURL}" | sed 's/%/\\x/g')
               URL=$(echo -e "${URL}")
	       _write_info
	       SETURL=
	    fi
	    if 	[ -f "${P}/.bypass" ] ; then
	   	echo -n "<td bgcolor=#a2b5cd>"
	    else
	    	echo -n "<td>"
	    fi
	    if [ -n "${URL}" ]; then
	       echo "<a href=\"${URL}\" target=_blank>${DUMMY}</a></td>"
	    else
	       echo "${DUMMY}</td>"
	    fi
	    if [ -f "$P/.info" ] ; then
		echo "<td>${STATUS}"
		echo " Start: ${STARTTIME}"
		[ -n "${ENDTIME}" ] && echo " End: ${ENDTIME}"
		[ -n "${SCRAPE}" ] && echo " ${SCRAPE}"
		if [ -n "${SETNOTE}" -a "${idx}" = "${ID}" ]; then
                   NOTE=$(echo "${SETNOTE}" | sed 's/%/\\x/g')
                   NOTE=$(echo -e "${NOTE}")
		   _write_info
		   SETNOTE=
		fi
		[ -n "${UPLOADED}" ] && echo " uploaded: ${UPLOADED} MB" 
		[ -n "${NOTE}" ] && echo " ${NOTE}"
		[ -f "${P}/.bypass" ] && echo ", bypassed"
		echo "</td></tr>"
	    fi
	    STARTTIME=
	    ENDTIME=
	    SCRAPE=
	    STATUS=
	    URL=
	    UPLOADED=
	    NOTE=
	    idx=`expr $idx + 1`
	done
	echo "</tbody></table>"
    echo
    fi
}

_list ()
{
    idx=0
    if [ -f "$WORK/.paused" ] ; then
	echo "<h3>Torrent processing paused!</h3>"
    fi
    __list "$WORK/*/*.torrent" "Active"
    __list "$TARGET/*/*.torrent.seeding" "Seeding"
    if [ -r "${SYSLOG}" ]; then
        SPEED=`tail ${SYSLOG}  | sed  -n '/transmissiond/s/.*\dl \([0-9.]\{1,\}\) ul \([0-9.]\{1,\}\).*/DOWNLOAD="\1";UPLOAD="\2"/p' | tail -1`
        eval "${SPEED}"
        if [ -n "${DOWNLOAD}"  ] ; then
	    echo "<table><tr><td>Total</td><td>Download ${DOWNLOAD}kB/s</td>"
	    echo "<td>Upload ${UPLOAD} kB/s</td></tr></table>"
        else
            echo "<p>Unable to find recent transfer stats in syslog</p>"
        fi
    else
        echo "<p>syslog: ${SYSLOG} unavailable for transfer stats!</p>"
    fi
    [ "${ACTION}" = "Update" ] && return
    __list "$WORK/*/*.torrent.suspended" "Suspended" 
    __list "$WORK/*/*.torrent.removed" "Removed" 
    __list "$SOURCE/*.torrent" "Queued"
    __list "$TARGET/*/*.torrent" "Done" 

}

_root_check () {
	if  [ ${USER} != admin -a  ${USER} != root ]; then
	    echo "You must be root! Because of killing stuff"
	    return 1
	fi
	return 0
}


_remove ()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi

    _find

   if [ -f "${TORRENT%.torrent.suspended}.torrent.suspended" ]; then
	mv "${TORRENT}" "${TORRENT%.suspended}.removed"
   else
	echo "<b>Can only remove suspended torrents!</b>"
   fi
}


_push()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find

    if [ -f "${TORRENT%.suspended}.suspended" ]; then
       _resume
       return
    fi

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
       if [ -f "${TORRENT%.torrent}.torrent" ]; then
	    _suspend
   	    return
       fi

    fi

    if [ -f "${TARGET}${TORRENT#${TARGET}}" ]; then
       _seed
       return
    fi 

    if [ -f "${SOURCE}${TORRENT#${SOURCE}}" ]; then
       _enqueue
       return
    fi

    echo "<p><em>Nothing to push!</em></p>" 
}


_bypass()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select active torrent first!</b>"
	return
    fi
    _find

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
	DUMMY="${TORRENT%/*}/.bypass"
     	if [ -f "${DUMMY}" ]; then 
	    rm -f "${DUMMY}"
	else
	    echo "This torrent is bypassed by watchdog" > "${DUMMY}"
	fi
	return
    else
    	echo "<p> Can only bypass active torrent!</p>"
    fi
}


_log ()
{

if [ ! -r ${SYSLOG} ]; then
  echo "<p>${SYSLOG} not readable. Properly configure syslogd at "
  echo "system startup.</p>"
  return
fi

echo "<pre>"
sed  -n -e "/ transmission.*:/{s/.*: \([0-9]\{1,10\}\) [0-9]\{1,\} dl \([0-9.]\{1,\}\) 
ul \([0-9.]\{1,\}\) ld \([0-9.]\{1,\}\)/\1 \2 -\3 \4/;t data;p;b;:data w ${GNUPLOT_DATA}" -e "}" ${SYSLOG} 
echo "</pre>"

if [ ! -x ${GNUPLOT} ]; then
  echo "<p>gnuplot: ${GNUPLOT} not found. Properly configure paths "
  echo "in transmission.conf for transfer graphing!</p>"
  return
fi

echo "<p>Creating graph...</p>"
TZO=${TIMEZONE_OFFSET:-0}
cat > ${GNUPLOT_COMMAND} << __EOF__
set terminal png small size 800,320
set output '${GNUPLOT_OUTPUT}'
set xdata time
set timefmt "%s"
set format x "%H:%M\n%m/%d"
set ytics nomirror
set y2tics nomirror
set y2range [0:]
set ylabel "Transmission transfer rate [kB/s]"
set y2label "System load (5 min average)"
set y2tics 1
set xlabel "Time [UTC ${TZO} seconds]"
plot '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):2 title 'download' axis x1y1 with impulses, \
     '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):3 title 'upload' with impulses, \
     '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):4 axis x1y2 title 'load' with lines
quit 
__EOF__

${GNUPLOT} ${GNUPLOT_COMMAND}

echo "<img src=\"${HTTP_IMG_LOCATION}\">"

}

_info ()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find
    echo "<h3>Torrent file metainfo</h3>"
    echo "<pre>"
    transmissioncli -i "${TORRENT}"
    echo "<p>"
    transmissioncli -s "${TORRENT}" | grep "seeder"
    echo "</p></pre>"
}

_help ()
{
    cat << __EOF__
This is quick explanation of the buttons:
<dl>
<dt><u>U</u>pdate<dd>updates active torrents status
<dt><u>P</u>ush<dd> Push selected torrent to other queue
<dt>Log<dd>shows <u>c</u>urrent transfer log graph
<dt><u>L</u>ist<dd>lists queued, active, suspended and completed torrents
<dt>U<u>R</u>L<dd>Enter URL location for torrent
<dt><u>N</u>ote<dd>Append your notes to torrent status
<dt>B<u>y</u>pass<dd>Bypass active torrent watchdog processing
<dt>Pur<u>g</u>e<dd>removes all logs from completed torrents and clean removed torrents
<dt><u>W</u>atchdog<dd>forces transmission_watchdog processing
<dt>Pau<u>s</u>e<dd>all active torrent processing should stop/resume imediately
<dt><u>R</u>emove<dd>mark torrent for purging
<dt><u>I</u>nfo<dd>shows selected torrent info (file content and size)
<dt>Scr<u>a</u>pe<dd>Update scrape info (seeders, leechers, downloaded)
     from tracker for downloaded torrents
<dt><u>B</u>est<dd>Search scrape for best done torrent and suggest seeding based on (leeches/seeds) ratio
<dt><u>F</u>etch<dd>Fetch torrent file from URL (link location)
<dt><u>H</u>elp<dd> Access keys <u>underlined</u>! Use Alt-Key for access. Button listing in descending importance.
</dl>

<p>Explanation of usage is available at NSLU2 Optware <a href=http://www.nslu2-linux.org/wiki/Optware/Transmission>
Transmission daemon wiki page</a>.</p>

__EOF__
if [ -r /opt/share/doc/transmission/README.daemon ]; then 
	echo "<pre>" 
	cat /opt/share/doc/transmission/README.daemon
	echo "</pre>" 
fi                                         
_root_check
}


cat << __EOF__                                 
Content-type: text/html

<html>
<head>
  <title>Transmission</title>
  <style type="text/css">
  <!--
      BODY { background-color: #F8F4E7; color: #552800 }
      A:link { color: #0000A0 }
      A:visited { color: #A000A0 }
      THEAD {
        background: #D0D0D0;
        color: #000000;
        text-align: center;
      }
      TBODY {
        background: #D0D0E7;
      }
   //-->
  </style>
</head>
<body>
<form action=transmission.cgi method=get>
<input type=submit accesskey=u name=ACTION value=Update>
<input type=submit accesskey=p name=ACTION value=Push>
<input type=submit accesskey=l name=ACTION value=List>
<input type=submit accesskey=c name=ACTION value=Log>
<input type=submit accesskey=r name=SETURL value=URL 
 onClick='value=prompt("Enter URL location to torrent page", "http://")'>
<input type=submit accesskey=n name=SETNOTE value=Note
 onClick='value=prompt("Enter your notes for this torrent")'>
<input type=submit accesskey=y name=ACTION value=Bypass>
<input type=submit accesskey=s name=ACTION value=Pause>
<input type=submit accesskey=w name=ACTION value=Watchdog>
<input type=submit accesskey=r name=ACTION value=Remove>
<input type=submit accesskey=g name=ACTION value=Purge>
<input type=submit accesskey=i name=ACTION value=Info>
<input type=submit accesskey=a name=ACTION value=Scrape>
<input type=submit accesskey=b name=ACTION value=Best>
<input type=submit accesskey=f name=FETCH value=Fetch
onClick='value=prompt("Enter torrent link location for fetching")'>
<input type=submit accesskey=h name=ACTION value=Help>
<! img align=top alt="" src=pingvin.gif>
<br>


__EOF__

QUERY_STRING=`echo "$QUERY_STRING" | sed 's/&/;/g'`
eval ${QUERY_STRING}


[ -n "${FETCH}" ] && _fetch

case "${ACTION}" in
    Update)	_update_progress ; _list ;;
    Log)	_log ;;
    Push)	_push ; _list ;;
    Pause)	_pause ; _list ;;
    Remove)	_remove; _list ;;
    Purge)	_purge ;;
    Watchdog)	transmission_watchdog ;;
    Info)	_info ;;
    Help)	_help ;;
    Scrape)	_scrape ; _list;;
    Best)	_best_seed ; _list;;
    Bypass)	_bypass; _list ;;
    *) _list ;;
esac

echo "<p>" ; ps ; free ; echo "</p>" 

cat << __EOF__  
</form>



<h3>Links</h3>
<ul>
  <li><a href=../source>source</a></li>
  <li><a href=../work>work</a></li>
  <li><a href=../target>target</a></li>
</ul>
<hr>
<address>
&copy; 2005-2007 oleo
</address>
</body>
</html>
__EOF__
June 25, 2007, at 10:17 PM by oleo --
Changed lines 469-472 from:

to:

June 25, 2007, at 10:16 PM by oleo --
Changed lines 469-472 from:

to:

June 25, 2007, at 10:14 PM by oleo --
Added line 468:
Added line 472:
June 25, 2007, at 10:10 PM by oleo --
Changed lines 468-470 from:

to:

June 25, 2007, at 10:08 PM by oleo -- move code
Changed lines 468-1157 from:
. /opt/etc/transmission.conf

PATH=/bin:/sbin:/usr/bin:/opt/sbin:/opt/bin:/usr/sbin
export PATH



_update_active()
{
    if [ -n "`ls ${WORK}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	ls -1  ${WORK}/*/*.torrent > ${ACTIVE}	
    else
    	rm -f ${ACTIVE}
    fi
    if [ -n "`ls ${TARGET}/*/*.seeding 2>/dev/null | head -n 1`" ] ; then
        ls -1  ${TARGET}/*/*.seeding >> ${ACTIVE}
    fi
    [ -f ${PIDFILE} ] && kill -HUP `cat ${PIDFILE}`
}
_write_info()
{
    echo "STARTTIME=\"${STARTTIME}\"
ENDTIME=\"${ENDTIME}\"
STATUS=\"${STATUS}\"
SCRAPE=\"${SCRAPE}\"
UPLOADED=\"${UPLOADED}\"
URL=\"${URL}\"
NOTE=\"${NOTE}\"
TORRENTNAME=\"${TORRENTNAME}\"" > "${TORRENT%/*}/.info"
}


_clean_info()
{
    STARTTIME=""
    ENDTIME=""
    STATUS=""
    SCRAPE=""
    TORRENTNAME=""
    UPLOADED=""
    URL=""
    NOTE=""
}


_update_progress()
{
    if [ -f ${PIDFILE} ]; then
        PID=`cat ${PIDFILE}`
        if `grep -q transmissiond /proc/${PID}/cmdline 2> /dev/null` ; then
            kill -USR1 ${PID}
            sleep 1     
            for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent.seeding
                do if [ -d "${TORRENT%/*}" ]; then
                    INFO="${TORRENT%/*}/.info"  
                    if [ -f "${INFO}" ]; then
	                . "${INFO}"
	                LOG="${TORRENT%/*}/.status"
	                if [ -f "${LOG}" ]; then
	                    .  "${LOG}"
	                else
	                    STATUS=".status not found for ${TORRENT}"
	                fi
                    else
	                _clean_info
                    fi
                    _write_info
                fi
            done
            UPLOADED=
            return      
        fi      
    else 
	echo "<p>Transmission daemon is not running.</p>"
	echo "<p>Status not updated!</p>"
    fi
}


_start_torrent()
{
    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ] ; then
	TMP="${TORRENT}"
	 . "${INFO}" 
	 TORRENT="${TMP}"
    else
	_clean_info
    fi
    [ -z "${STARTTIME}" ] && STARTTIME=`date +"${DATE_FORMAT}"`
    STATUS="started"
    UPLOADED=
    _write_info
    _update_active
}

_stop_torrent ()
{
    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f  "${INFO}"  ] ; then
	. "${INFO}"
	[ -z "${ENDTIME}" ] && ENDTIME=`date +"${DATE_FORMAT}"`
	STATUS=`echo "${STATUS}"|sed -e 's/Progress: \([0-9\.]\{2,6\} %\).*/\1/p;d'`
	_write_info
	_update_active
    fi
}



_enqueue()
{
    TORRENTNAME="${TORRENT%.torrent}"
    TORRENTNAME="${TORRENTNAME##*/}"
    mkdir -p "$WORK/$TORRENTNAME"                                               
    chmod 777 "$WORK/$TORRENTNAME" 
    mv "${TORRENT}" "$WORK/$TORRENTNAME"
    TORRENT="$WORK/$TORRENTNAME/${TORRENTNAME}.torrent"       
    _write_info
    _start_torrent "${TORRENT}"
}


_suspend ()
{
    mv "${TORRENT}" "${TORRENT}.suspended"
    _stop_torrent "${TORRENT}"
}


_resume ()
{

    mv "${TORRENT}" "${TORRENT%.suspended}"
    _start_torrent "${TORRENT%.suspended}"
}


_seed ()
{

   if [ ! -f "${TARGET}${TORRENT#${TARGET}}" ] ; then
	echo "<b>Can only seed already done torrents</b>"
	return
   fi

   if [ -f "${TORRENT%.seeding}" ]; then
	mv "${TORRENT}" "${TORRENT}.seeding"
	_start_torrent "${TORRENT}.seeding"
   else
	mv "${TORRENT}" "${TORRENT%.seeding}"
	_stop_torrent "${TORRENT%.seeding}"
   fi 
}


_purge ()
{
    LOG=`ls -1 $TARGET/*/.info 2>/dev/null | head -n 1`
    if [ -z "${LOG}" ] ; then
	echo "No .info to purge."
    else
      echo "<pre>"
      for f in $TARGET/*/.info ; do
	  DUMMY="${f%/.info}"
	  TORRENT="${DUMMY}/${DUMMY##*/}.torrent.seeding"
	  if [ -f "${TORRENT}" ]; then
		echo "<b>status $f not purged</b>"
	  else
          	echo "Puging ${DUMMY}"
		[ -f "${DUMMY}/.status" ] && rm "${DUMMY}/.status"
		. "${f}"
		STATUS=""
		_write_info
	  fi 
      done
      echo "</pre>"
    fi

    REMOVED=`ls -1 $WORK/*/*.torrent.removed 2>/dev/null | head -n 1`
    if [ -n "${REMOVED}" ]; then
        echo "<pre>"
	for f in $WORK/*/*.torrent.removed ; do
		DIR="${f%/*}"
		echo "Purging $DIR"
		rm -fr "${DIR}"			
	done
        echo "</pre>"
    fi
}


_pause ()
{
    if [ -f "$WORK/.paused" ] ; then
	rm "$WORK/.paused"

	[ -e ${PIDFILE} ] && rm ${PIDFILE}
	export HOME
	_update_active
	if  false ; then
	        echo "Starting transmission daemon ..." 
                transmissiond -p ${LISTENING_PORT} \
                ${NAT_TRAVERSAL} \
		-w ${WATCHDOG} \
		-u ${UPLOAD_SPEED} \
		-d ${DOWNLOAD_SPEED} \
		-i ${PIDFILE}   ${ACTIVE}
	    sleep 5
	    if [ -f ${PIDFILE} ]; then
		PID=`cat ${PIDFILE}`
		echo "<p>Transmission daemon started with PID=${PID}</p>"
	    else
		echo "<p><b>Transmission daemon failed to start</b></p>" 
	    fi
	else
	  echo "<p>transmission_watchdog will start Transmission daemon.</p>"
          echo "<p>Press Watchdog button to force watchdog queue processing</p>"
	fi
    else
	touch "$WORK/.paused"
	kill -TERM `cat ${PIDFILE}`
	echo "<b>Stopping transmissison!</b>"
	echo "<p>Transmission will eventually stop. "
	echo "Last Log line should report transmissiond exiting.<p>"
    fi
}


_scrape ()
{
  for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent* ; do
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ]; then
	. "${INFO}"
	SCRAPE=`transmissioncli -s "${TORRENT}" | grep seeder`
	DUMMY=$?
	_write_info
	if [ $DUMMY != 0 ]; then
	   echo "<p>${TORRENT} scrape failed</p>"
	fi
	UPLOADED=
	echo "."
    fi  
  done
  echo " done."
}


_best_seed ()                     
{                                
   BEST=0              
    if [ -n "`ls ${TARGET}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	for TORRENT in ${TARGET}/*/*.torrent ; do
	    INFO="${TORRENT%/*}/.info"
	    if [ -f "${INFO}" ]; then
		. "${INFO}"
		QUOTIENT=`echo "${SCRAPE}" | sed -n -e '/seeder/s/\([0-9]\{1,\}\) seeder(s), \([0-9]\{1,\}\) leecher.*/(\2000\/(\1+1)/p;d'` 
		RATIO=$((QUOTIENT))
		if [ ${RATIO} -gt ${BEST} ]; then
		    BESTTORRENT="${TORRENT}"
		    BESTSCRAPE="${SCRAPE}"
		    BEST=${RATIO}
		fi                                   
            fi       
	done 
	echo "<h3>Best seed suggestion</h3>"
	echo "<p>${BESTTORRENT##*/}</p>"
	echo "<p>${BESTSCRAPE}</p>"
   else                                                                
	echo "<b>No torrents to suggest for seeding</b>"
   fi                                       
}


_fetch()
{
    TORRENT=$(echo "${FETCH}" |sed 's/%/\\x/g')
    TORRENT=$(echo -e "${TORRENT}")
    echo "<p>Fetching ${TORRENT}</p>"
    wget -q -P ${SOURCE} "${TORRENT}"  ||  echo "<p>wget ${TORRENT} failed</p>"
}



__find ()
{
    [ -n "${TORRENT}" ] && return

    FILEPAT="$1"
    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ] ; then
	for i in $FILEPAT ; do
	    if [ $ID = $idx ]; then
		TORRENT="$i"

		return
	    fi
	    idx=$(($idx+1)) 
	done
    fi
}


_find ()
{
    idx=0 
    TORRENT=""
    __find "$WORK/*/*.torrent"
    __find "$TARGET/*/*.torrent.seeding"
    __find "$WORK/*/*.torrent.suspended"
    __find "$WORK/*/*.torrent.removed"
    __find "$SOURCE/*.torrent"
    __find "$TARGET/*/*.torrent" 
   [ -z "${TORRENT}" ] && echo "Assertion failed [ -z TORRENT ] in _find()" 
}

__list ()
{
    FILEPAT="$1"
    DESC="$2"

    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ]
    then
	echo "<table>"
	echo "<thead><tr><td></td><td>${DESC}</td><td>status</td></tr>"
	echo "</thead><tbody>"
	for i in $FILEPAT
	do
	    DUMMY="${i%.torrent*}"
	    P="${i%/*}"
	    DUMMY=${DUMMY##*/}
	    echo "<tr><td><input name=ID value=$idx type=radio></td>"
	    if [ -f "${P}/.info" ];then
	       . "${P}/.info" 
	    else
	       _clean_info
	    fi
	    TORRENT="$i"
	    if [ -n "${SETURL}" -a "${idx}" = "${ID}" ]; then
	       URL=$(echo "${SETURL}" | sed 's/%/\\x/g')
               URL=$(echo -e "${URL}")
	       _write_info
	       SETURL=
	    fi
	    if 	[ -f "${P}/.bypass" ] ; then
	   	echo -n "<td bgcolor=#a2b5cd>"
	    else
	    	echo -n "<td>"
	    fi
	    if [ -n "${URL}" ]; then
	       echo "<a href=\"${URL}\" target=_blank>${DUMMY}</a></td>"
	    else
	       echo "${DUMMY}</td>"
	    fi
	    if [ -f "$P/.info" ] ; then
		echo "<td>${STATUS}"
		echo " Start: ${STARTTIME}"
		[ -n "${ENDTIME}" ] && echo " End: ${ENDTIME}"
		[ -n "${SCRAPE}" ] && echo " ${SCRAPE}"
		if [ -n "${SETNOTE}" -a "${idx}" = "${ID}" ]; then
                   NOTE=$(echo "${SETNOTE}" | sed 's/%/\\x/g')
                   NOTE=$(echo -e "${NOTE}")
		   _write_info
		   SETNOTE=
		fi
		[ -n "${UPLOADED}" ] && echo " uploaded: ${UPLOADED} MB" 
		[ -n "${NOTE}" ] && echo " ${NOTE}"
		[ -f "${P}/.bypass" ] && echo ", bypassed"
		echo "</td></tr>"
	    fi
	    STARTTIME=
	    ENDTIME=
	    SCRAPE=
	    STATUS=
	    URL=
	    UPLOADED=
	    NOTE=
	    idx=`expr $idx + 1`
	done
	echo "</tbody></table>"
    echo
    fi
}

_list ()
{
    idx=0
    if [ -f "$WORK/.paused" ] ; then
	echo "<h3>Torrent processing paused!</h3>"
    fi
    __list "$WORK/*/*.torrent" "Active"
    __list "$TARGET/*/*.torrent.seeding" "Seeding"
    if [ -r "${SYSLOG}" ]; then
        SPEED=`tail ${SYSLOG}  | sed  -n '/transmissiond/s/.*\dl \([0-9.]\{1,\}\) ul \([0-9.]\{1,\}\).*/DOWNLOAD="\1";UPLOAD="\2"/p' | tail -1`
        eval "${SPEED}"
        if [ -n "${DOWNLOAD}"  ] ; then
	    echo "<table><tr><td>Total</td><td>Download ${DOWNLOAD}kB/s</td>"
	    echo "<td>Upload ${UPLOAD} kB/s</td></tr></table>"
        else
            echo "<p>Unable to find recent transfer stats in syslog</p>"
        fi
    else
        echo "<p>syslog: ${SYSLOG} unavailable for transfer stats!</p>"
    fi
    [ "${ACTION}" = "Update" ] && return
    __list "$WORK/*/*.torrent.suspended" "Suspended" 
    __list "$WORK/*/*.torrent.removed" "Removed" 
    __list "$SOURCE/*.torrent" "Queued"
    __list "$TARGET/*/*.torrent" "Done" 

}

_root_check () {
	if  [ ${USER} != admin -a  ${USER} != root ]; then
	    echo "You must be root! Because of killing stuff"
	    return 1
	fi
	return 0
}


_remove ()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi

    _find

   if [ -f "${TORRENT%.torrent.suspended}.torrent.suspended" ]; then
	mv "${TORRENT}" "${TORRENT%.suspended}.removed"
   else
	echo "<b>Can only remove suspended torrents!</b>"
   fi
}


_push()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find

    if [ -f "${TORRENT%.suspended}.suspended" ]; then
       _resume
       return
    fi

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
       if [ -f "${TORRENT%.torrent}.torrent" ]; then
	    _suspend
   	    return
       fi

    fi

    if [ -f "${TARGET}${TORRENT#${TARGET}}" ]; then
       _seed
       return
    fi 

    if [ -f "${SOURCE}${TORRENT#${SOURCE}}" ]; then
       _enqueue
       return
    fi

    echo "<p><em>Nothing to push!</em></p>" 
}


_bypass()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select active torrent first!</b>"
	return
    fi
    _find

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
	DUMMY="${TORRENT%/*}/.bypass"
     	if [ -f "${DUMMY}" ]; then 
	    rm -f "${DUMMY}"
	else
	    echo "This torrent is bypassed by watchdog" > "${DUMMY}"
	fi
	return
    else
    	echo "<p> Can only bypass active torrent!</p>"
    fi
}


_log ()
{

if [ ! -r ${SYSLOG} ]; then
  echo "<p>${SYSLOG} not readable. Properly configure syslogd at "
  echo "system startup.</p>"
  return
fi

echo "<pre>"
sed  -n -e "/ transmission.*:/{s/.*: \([0-9]\{1,10\}\) [0-9]\{1,\} dl \([0-9.]\{1,\}\) ul \([0-9.]\{1,\}\) ld \([0-9.]\{1,\}\)/\1 \2 -\3 \4/;t data;p;b;:data w ${GNUPLOT_DATA}" -e "}" ${SYSLOG} 
echo "</pre>"

if [ ! -x ${GNUPLOT} ]; then
  echo "<p>gnuplot: ${GNUPLOT} not found. Properly configure paths "
  echo "in transmission.conf for transfer graphing!</p>"
  return
fi

echo "<p>Creating graph...</p>"
TZO=${TIMEZONE_OFFSET:-0}
cat > ${GNUPLOT_COMMAND} << __EOF__
set terminal png small size 800,320
set output '${GNUPLOT_OUTPUT}'
set xdata time
set timefmt "%s"
set format x "%H:%M\n%m/%d"
set ytics nomirror
set y2tics nomirror
set y2range [0:]
set ylabel "Transmission transfer rate [kB/s]"
set y2label "System load (5 min average)"
set y2tics 1
set xlabel "Time [UTC ${TZO} seconds]"
plot '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):2 title 'download' axis x1y1 with impulses, \
     '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):3 title 'upload' with impulses, \
     '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):4 axis x1y2 title 'load' with lines
quit 
__EOF__

${GNUPLOT} ${GNUPLOT_COMMAND}

echo "<img src=\"${HTTP_IMG_LOCATION}\">"

}

_info ()
{
    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find
    echo "<h3>Torrent file metainfo</h3>"
    echo "<pre>"
    transmissioncli -i "${TORRENT}"
    echo "<p>"
    transmissioncli -s "${TORRENT}" | grep "seeder"
    echo "</p></pre>"
}

_help ()
{
    cat << __EOF__
This is quick explanation of the buttons:
<dl>
<dt><u>U</u>pdate<dd>updates active torrents status
<dt><u>P</u>ush<dd> Push selected torrent to other queue
<dt>Log<dd>shows <u>c</u>urrent transfer log graph
<dt><u>L</u>ist<dd>lists queued, active, suspended and completed torrents
<dt>U<u>R</u>L<dd>Enter URL location for torrent
<dt><u>N</u>ote<dd>Append your notes to torrent status
<dt>B<u>y</u>pass<dd>Bypass active torrent watchdog processing
<dt>Pur<u>g</u>e<dd>removes all logs from completed torrents and clean removed torrents
<dt><u>W</u>atchdog<dd>forces transmission_watchdog processing
<dt>Pau<u>s</u>e<dd>all active torrent processing should stop/resume imediately
<dt><u>R</u>emove<dd>mark torrent for purging
<dt><u>I</u>nfo<dd>shows selected torrent info (file content and size)
<dt>Scr<u>a</u>pe<dd>Update scrape info (seeders, leechers, downloaded)
     from tracker for downloaded torrents
<dt><u>B</u>est<dd>Search scrape for best done torrent and suggest seeding based on (leeches/seeds) ratio
<dt><u>F</u>etch<dd>Fetch torrent file from URL (link location)
<dt><u>H</u>elp<dd> Access keys <u>underlined</u>! Use Alt-Key for access. Button listing in descending importance.
</dl>

<p>Explanation of usage is available at NSLU2 Optware <a href=http://www.nslu2-linux.org/wiki/Optware/Transmission>
Transmission daemon wiki page</a>.</p>

__EOF__
if [ -r /opt/share/doc/transmission/README.daemon ]; then 
	echo "<pre>" 
	cat /opt/share/doc/transmission/README.daemon
	echo "</pre>" 
fi                                         
_root_check
}


cat << __EOF__                                 
Content-type: text/html

<html>
<head>
  <title>Transmission</title>
  <style type="text/css">
  <!--
      BODY { background-color: #F8F4E7; color: #552800 }
      A:link { color: #0000A0 }
      A:visited { color: #A000A0 }
      THEAD {
        background: #D0D0D0;
        color: #000000;
        text-align: center;
      }
      TBODY {
        background: #D0D0E7;
      }
   //-->
  </style>
</head>
<body>
<form action=transmission.cgi method=get>
<input type=submit accesskey=u name=ACTION value=Update>
<input type=submit accesskey=p name=ACTION value=Push>
<input type=submit accesskey=l name=ACTION value=List>
<input type=submit accesskey=c name=ACTION value=Log>
<input type=submit accesskey=r name=SETURL value=URL 
 onClick='value=prompt("Enter URL location to torrent page", "http://")'>
<input type=submit accesskey=n name=SETNOTE value=Note
 onClick='value=prompt("Enter your notes for this torrent")'>
<input type=submit accesskey=y name=ACTION value=Bypass>
<input type=submit accesskey=s name=ACTION value=Pause>
<input type=submit accesskey=w name=ACTION value=Watchdog>
<input type=submit accesskey=r name=ACTION value=Remove>
<input type=submit accesskey=g name=ACTION value=Purge>
<input type=submit accesskey=i name=ACTION value=Info>
<input type=submit accesskey=a name=ACTION value=Scrape>
<input type=submit accesskey=b name=ACTION value=Best>
<input type=submit accesskey=f name=FETCH value=Fetch
onClick='value=prompt("Enter torrent link location for fetching")'>
<input type=submit accesskey=h name=ACTION value=Help>
<! img align=top alt="" src=pingvin.gif>
<br>


__EOF__

QUERY_STRING=`echo "$QUERY_STRING" | sed 's/&/;/g'`
eval ${QUERY_STRING}


[ -n "${FETCH}" ] && _fetch

case "${ACTION}" in
    Update)	_update_progress ; _list ;;
    Log)	_log ;;
    Push)	_push ; _list ;;
    Pause)	_pause ; _list ;;
    Remove)	_remove; _list ;;
    Purge)	_purge ;;
    Watchdog)	transmission_watchdog ;;
    Info)	_info ;;
    Help)	_help ;;
    Scrape)	_scrape ; _list;;
    Best)	_best_seed ; _list;;
    Bypass)	_bypass; _list ;;
    *) _list ;;
esac

echo "<p>" ; ps ; free ; echo "</p>" 

cat << __EOF__  
</form>



<h3>Links</h3>
<ul>
  <li><a href=../source>source</a></li>
  <li><a href=../work>work</a></li>
  <li><a href=../target>target</a></li>
</ul>
<hr>
<address>
&copy; 2005-2007 oleo
</address>
</body>
</html>
__EOF__
to:

June 25, 2007, at 10:06 PM by oleo -- OpenWrt notes
Changed lines 152-153 from:

Should be increased to 100k or more to see logs for more than one day.

to:

There is also possibility to use circular syslog, but this requires changes to transmission.cgi source code. Size be increased to 100k or more to see logs for more than one day.

Changed lines 159-160 from:

It looks like that only circular syslog is started at boot and that

to:

OpenWrt comes with its own syslog that by default uses 16 kB circular syslog. It looks like that only circular syslog is started at boot and that

Changed lines 166-177 from:
to:

This will give us to possibility to use regular file. It is recommended that syslog file is set as /var/log/messages and that size is limited to 100kB. This eliminates logrotate requirement for Transmission. Note that /var/log/messages resides in RAM. But we can spare 100kB of it.

Crontab on OpenWrt

It is recommended that we use OpenWrt cron daemon as it comes built in. One needs just add the following line to @/etc/crontabs/root@ file:

 */30 * * * * nice /opt/sbin/transmission_watchdog
June 24, 2007, at 08:34 PM by oleo -- openwrt syslog
Added lines 156-163:

Syslog on OpenWrt

It looks like that only circular syslog is started at boot and that symbolic link is needed to start user configured syslog. This can be done with

  root@oleo:/etc/rc.d# ln -s /etc/init.d/syslog /etc/rc.d/S15syslogd

but check for existance of syslog entry in /etc/rc.d before!

Changed line 373 from:

Step 4 - Install Tranmission

to:

Step 4 - Install Transmission

June 01, 2007, at 10:16 AM by oleo -- formatting
Added line 245:

[@

Changed lines 248-249 from:
to:

@]

Changed lines 251-253 from:
 /opt/etc/init.d/rc.unslungNext let's create the post-firewall file

Code:

to:
 /opt/etc/init.d/rc.unslung

Next let's create the post-firewall file

[@

Changed lines 258-260 from:

Code:

  1. !/bin/sh
to:

@]

[@#!/bin/sh

Changed lines 271-273 from:

Code: touch /usr/local/sbin/post-mount

to:

@]

[@touch /usr/local/sbin/post-mount

Changed lines 276-277 from:

chmod +x /usr/local/sbin/*9) Save to flash and reboot

to:

chmod +x /usr/local/sbin/*

]

9) Save to flash and reboot

Changed lines 282-288 from:

flashfs save && flashfs commit && flashfs enable && rebootAt the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this with

Code: mount freeThis should produce an output similar to

Code:

to:
 flashfs save && flashfs commit && flashfs enable && reboot

At the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this with

 mount
free

This should produce an output similar to

[@

Changed lines 306-309 from:

Total: 530852 13744 517108Step3 - Install samba2

to:

Total: 530852 13744 517108 @]

Step3 - Install samba2

Changed line 312 from:
to:

[@

Changed lines 316-317 from:
to:

@]

Added line 320:

[@

Changed lines 323-324 from:
to:

@]

Changed lines 327-329 from:
 nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:
to:

nano /opt/etc/init.d/rc.unslung

Here is my rc.unslung file: [@

Changed lines 359-360 from:
to:

@]

Added line 368:

[@

Changed line 373 from:
to:

@]

Changed line 376 from:
 mkdir /mnt/torrent
to:

[@ mkdir /mnt/torrent

Changed lines 384-385 from:
to:

@]

Changed lines 387-393 from:

Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

In case your admin userid was changed to something else, pls edit /opt/share/www/cgi-bin/transmission.cgi accordingly.

Edit your opt/etc/crontab file. Mine is (replace xxxx with your admin userid):

 SHELL=/bin/sh
to:

Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

In case your admin userid was changed to something else, pls edit /opt/share/www/cgi-bin/transmission.cgi accordingly.

Edit your /opt/etc/crontab file. Mine is (replace xxxx with your admin userid):

[@ SHELL=/bin/sh

Changed lines 400-401 from:
to:

@]

Changed lines 404-405 from:
 nano /opt/etc/init.d/S05syslogd
to:

nano /opt/etc/init.d/S05syslogd

Changed line 407 from:
to:

[@

Changed lines 417-418 from:
 /sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:
to:
 /sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7

@] Make it executable, and reboot:

[@

Changed lines 425-429 from:
 You can access Transmission from Windows pointing your browser to    http://192.168.1.1:8008/cgi-bin/transmission.cgi

 Next Steps (optional)
to:

@]

 You can access Transmission from Windows pointing your browser to    

http://192.168.1.1:8008/cgi-bin/transmission.cgi

Next Steps (optional)

Changed line 447 from:
to:

[@

Changed lines 1134-1137 from:

You can create softlinks (ln -s ...) from /home/httpd/html to your source, work and target directory.

to:

@]

You can create softlinks (ln -s ...) from /home/httpd/html to your source, work and target directory.

Changed lines 1139-1145 from:

This file is located in /opt/etc/ Warning: adjust the locations for SOURCE, WORK and TARGET according to your wishes. The same for PIDFILE, ACTIVE and HOME. Also change the LISTENING_PORT if you need to (depending on your firewall-settings)

SOURCE=/share/hdd/data/Torrents/Source

to:

This file is located in /opt/etc/ Warning: adjust the locations for SOURCE, WORK and TARGET according to your wishes. The same for PIDFILE, ACTIVE and HOME. Also change the LISTENING_PORT if you need to

 (depending on your firewall-settings)

[@SOURCE=/share/hdd/data/Torrents/Source

Deleted lines 1165-1166:
Changed lines 1186-1187 from:
to:

@]

April 12, 2007, at 05:44 AM by oleo -- multitracker
Changed line 8 from:
  • PEX support, UPNP support, Bandwith limiting
to:
  • Miltitracker, PEX support, UPNP support, Bandwith limiting
April 09, 2007, at 03:25 PM by fcarolo -- link formatting
Changed line 339 from:

Open your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:

to:

Open your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:

Changed line 412 from:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the directory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

to:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the directory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

April 08, 2007, at 10:43 PM by oleo -- libtransmission features
Added line 8:
  • PEX support, UPNP support, Bandwith limiting
Changed line 10 from:
  • configurable ports
to:
  • configurable port
April 06, 2007, at 09:25 PM by Joop Verdoorn -- Configuration files for NSLU2
Changed lines 408-409 from:

The optware package for transmission doesn't deliver everything right. It point to wrong file-locaties etc. The easiest way is to copy the filecontents of the files described here to your files and sometimes to change filelocations.

to:

The optware package for transmission doesn't deliver everything right. It points to wrong file-locaties etc. The easiest way is to copy the filecontents of the files described here, to your files and sometimes to change filelocations.

Changed line 411 from:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the diectory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

to:

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the directory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!).

Changed line 558 from:
   # Double check
to:
Changed line 712 from:
  1. echo "Found $idx ${TORRENT}"
to:
Deleted lines 873-874:
       # Removed ? Not pushed
    fi
Added lines 875-876:
    fi
April 06, 2007, at 09:22 PM by Joop Verdoorn -- Configuration for NSLU2
Changed lines 412-421 from:

The file-contents of transmission.cgi can be changed to:

  1. !/bin/sh
  2. httpd.conf for busybox_httpd -p 8008 -c /opt/etc/httpd.conf -h /opt/share/www
  3. A:*
  4. /cgi-bin:admin:admin
  5. For thttpd.conf add cgipat=/cgi-bin/* and user=admin
  6. replace standard "admin" on wl500gx with "root" for other systems
  7. /bin/sh can be BusyBox v1.1.3 applet
to:

The file-contents of transmission.cgi can be changed to (I've removed al the comments, as this wiki transforms the #'s into numbers):

Changed lines 422-425 from:
  1. The functions
  1. rewrites active torrents listing into file and notifies daemon to reload it
to:
Deleted lines 434-435:
  1. writes .info file describing some torrent stats
Changed line 447 from:
  1. creates clean info contents
to:
Changed line 494 from:
  1. Can only start torrents in WORK or TARGET
to:
Changed line 527 from:
  1. Move selected torrent to work dir and start it
to:
Changed line 540 from:
  1. Suspend active torrent
to:
Changed line 547 from:
  1. Resume suspended torrent
to:
Changed line 555 from:
  1. Seed/unSeed DONE torrents
to:
Changed line 573 from:
  1. Purge log files in target and cleanup removed
to:
Changed line 609 from:
  1. Instruct watchdog to stop/start all active torrents
to:
Changed line 646 from:
  1. Update scrape info for active and downloaded torrents
to:
Changed lines 666-667 from:
  1. Search for best done torrent and suggest seeding based on ratio
  2. Not very clever at the moment
to:
Changed line 692 from:
  1. Fetch torrent from URL location given with FETCH
to:
Changed line 702 from:
  1. Sub for directory search
to:
Deleted lines 720-721:
  1. Search for torrent ID through directories. Must be in sync with _list()
  2. When found TORRENT is set. Should always find!
Changed line 838 from:
  1. Mark torrent as removed. Purge will do cleanup
to:
Changed line 855 from:
  1. Determine what to do? _resume|_suspend|_seed
to:
Changed line 890 from:
  1. Toggle bypass flag
to:
Changed lines 912-913 from:
  1. Show transfer log from log file
  2. Replace "transmissiond" with "transmission" if all logs are preferred
to:
Changed lines 1010-1011 from:
  1. MAIN PROCESS
to:
Changed lines 1062-1065 from:
  1. export ACTION
  2. /opt/bin/printenv
  3. set
to:
Changed lines 1111-1114 from:
  1. Configuration
  2. NOTE: no spaces around the = sign
  3. the config will be sourced (eg. . transmission.conf)
to:
Changed lines 1116-1117 from:
  1. MAILTO=torrent@somedomain.com
  2. MAILFROM=torrent@somedomain.com
to:
Changed line 1122 from:
  1. Transmission daemon variables
to:
Changed line 1128 from:
  1. set SPEED in kB/s or -1 for unlimited
to:
Changed lines 1131-1133 from:
  1. UPLOAD_SPEED=41
  2. DOWNLOAD_SPEED=180
  3. change SYSLOG from /tmp/syslog.log to
to:
Changed lines 1134-1137 from:
  1. Uncomment the following for UPNP NAT traversal
  2. NAT_TRAVERSAL=--nat-traversal
  3. Seed torrent after completition (YES or NO)
to:
Changed line 1137 from:
  1. If the following limit is reached watchdog will not enqueue new one
to:
Changed lines 1140-1142 from:
  1. Creating graphical log of transfer with gnuplot
  2. can be very site specific issue. See transmission.cgi
  3. how this variables are used.
to:
Changed lines 1145-1146 from:

HTTP_IMG_LOCATION=../transfer.png

  1. TZ offset in seconds. Use +- sign. DST manually
to:
Changed line 1148 from:
  1. Colors for command line. # comment out if not needed
to:
Changed lines 1150-1151 from:
  1. NC="\033[0m"
  2. BACK_UP="\033[1K\033[0G"
to:
April 06, 2007, at 09:16 PM by Joop Verdoorn -- Added configuration for NSLU2
Changed lines 407-1192 from:
to:

Install notes for transmission on NLSU2? with Unslung 6.8

The optware package for transmission doesn't deliver everything right. It point to wrong file-locaties etc. The easiest way is to copy the filecontents of the files described here to your files and sometimes to change filelocations.

Adjusted transmission.cgi

This file can be copied from /opt/share/www/cgi-bin to /home/httpd/html/cgi-bin (you need to create the diectory cgi-bin). You can call the webinterface in your webbrowser by something like: http://192.168.123.192/cgi-bin/transmission.cgi (use your slugs-ip-adress instead of 192.168.123.192!). The file-contents of transmission.cgi can be changed to:

  1. !/bin/sh
  2. httpd.conf for busybox_httpd -p 8008 -c /opt/etc/httpd.conf -h /opt/share/www
  3. A:*
  4. /cgi-bin:admin:admin
  5. For thttpd.conf add cgipat=/cgi-bin/* and user=admin
  6. replace standard "admin" on wl500gx with "root" for other systems
  7. /bin/sh can be BusyBox v1.1.3 applet

. /opt/etc/transmission.conf

PATH=/bin:/sbin:/usr/bin:/opt/sbin:/opt/bin:/usr/sbin export PATH

  1. The functions
  1. rewrites active torrents listing into file and notifies daemon to reload it

_update_active() {

    if [ -n "`ls ${WORK}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	ls -1  ${WORK}/*/*.torrent > ${ACTIVE}	
    else
    	rm -f ${ACTIVE}
    fi
    if [ -n "`ls ${TARGET}/*/*.seeding 2>/dev/null | head -n 1`" ] ; then
        ls -1  ${TARGET}/*/*.seeding >> ${ACTIVE}
    fi
    [ -f ${PIDFILE} ] && kill -HUP `cat ${PIDFILE}`

}

  1. writes .info file describing some torrent stats

_write_info() {

    echo "STARTTIME=\"${STARTTIME}\"

ENDTIME=\"${ENDTIME}\" STATUS=\"${STATUS}\" SCRAPE=\"${SCRAPE}\" UPLOADED=\"${UPLOADED}\" URL=\"${URL}\" NOTE=\"${NOTE}\" TORRENTNAME=\"${TORRENTNAME}\"" > "${TORRENT%/*}/.info" }

  1. creates clean info contents

_clean_info() {

    STARTTIME=""
    ENDTIME=""
    STATUS=""
    SCRAPE=""
    TORRENTNAME=""
    UPLOADED=""
    URL=""
    NOTE=""

}

_update_progress() {

    if [ -f ${PIDFILE} ]; then
        PID=`cat ${PIDFILE}`
        if `grep -q transmissiond /proc/${PID}/cmdline 2> /dev/null` ; then
            kill -USR1? ${PID}
            sleep 1     
            for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent.seeding
                do if [ -d "${TORRENT%/*}" ]; then
                    INFO="${TORRENT%/*}/.info"  
                    if [ -f "${INFO}" ]; then
	                . "${INFO}"
	                LOG="${TORRENT%/*}/.status"
	                if [ -f "${LOG}" ]; then
	                    .  "${LOG}"
	                else
	                    STATUS=".status not found for ${TORRENT}"
	                fi
                    else
	                _clean_info
                    fi
                    _write_info
                fi
            done
            UPLOADED=
            return      
        fi      
    else 
	echo "<p>Transmission daemon is not running.</p>"
	echo "<p>Status not updated!</p>"
    fi

}

  1. Can only start torrents in WORK or TARGET

_start_torrent() {

    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ] ; then
	TMP="${TORRENT}"
	 . "${INFO}" 
	 TORRENT="${TMP}"
    else
	_clean_info
    fi
    [ -z "${STARTTIME}" ] && STARTTIME=`date +"${DATE_FORMAT}"`
    STATUS="started"
    UPLOADED=
    _write_info
    _update_active

}

_stop_torrent () {

    TORRENT="$1"
    INFO="${TORRENT%/*}/.info"
    if [ -f  "${INFO}"  ] ; then
	. "${INFO}"
	[ -z "${ENDTIME}" ] && ENDTIME=`date +"${DATE_FORMAT}"`
	STATUS=`echo "${STATUS}"|sed -e 's/Progress: \([0-9\.]\{2,6\} %\).*/\1/p;d'`
	_write_info
	_update_active
    fi

}

  1. Move selected torrent to work dir and start it

_enqueue() {

    TORRENTNAME="${TORRENT%.torrent}"
    TORRENTNAME="${TORRENTNAME##*/}"
    mkdir -p "$WORK/$TORRENTNAME"                                               
    chmod 777 "$WORK/$TORRENTNAME" 
    mv "${TORRENT}" "$WORK/$TORRENTNAME"
    TORRENT="$WORK/$TORRENTNAME/${TORRENTNAME}.torrent"       
    _write_info
    _start_torrent "${TORRENT}"

}

  1. Suspend active torrent

_suspend () {

    mv "${TORRENT}" "${TORRENT}.suspended"
    _stop_torrent "${TORRENT}"

}

  1. Resume suspended torrent

_resume () {

    mv "${TORRENT}" "${TORRENT%.suspended}"
    _start_torrent "${TORRENT%.suspended}"

}

  1. Seed/unSeed DONE torrents

_seed () {

   # Double check
   if [ ! -f "${TARGET}${TORRENT#${TARGET}}" ] ; then
	echo "<b>Can only seed already done torrents</b>"
	return
   fi

   if [ -f "${TORRENT%.seeding}" ]; then
	mv "${TORRENT}" "${TORRENT}.seeding"
	_start_torrent "${TORRENT}.seeding"
   else
	mv "${TORRENT}" "${TORRENT%.seeding}"
	_stop_torrent "${TORRENT%.seeding}"
   fi 

}

  1. Purge log files in target and cleanup removed

_purge () {

    LOG=`ls -1 $TARGET/*/.info 2>/dev/null | head -n 1`
    if [ -z "${LOG}" ] ; then
	echo "No .info to purge."
    else
      echo "<pre>"
      for f in $TARGET/*/.info ; do
	  DUMMY="${f%/.info}"
	  TORRENT="${DUMMY}/${DUMMY##*/}.torrent.seeding"
	  if [ -f "${TORRENT}" ]; then
		echo "<b>status $f not purged</b>"
	  else
          	echo "Puging ${DUMMY}"
		[ -f "${DUMMY}/.status" ] && rm "${DUMMY}/.status"
		. "${f}"
		STATUS=""
		_write_info
	  fi 
      done
      echo "</pre>"
    fi

    REMOVED=`ls -1 $WORK/*/*.torrent.removed 2>/dev/null | head -n 1`
    if [ -n "${REMOVED}" ]; then
        echo "<pre>"
	for f in $WORK/*/*.torrent.removed ; do
		DIR="${f%/*}"
		echo "Purging $DIR"
		rm -fr "${DIR}"			
	done
        echo "</pre>"
    fi

}

  1. Instruct watchdog to stop/start all active torrents

_pause () {

    if [ -f "$WORK/.paused" ] ; then
	rm "$WORK/.paused"

	[ -e ${PIDFILE} ] && rm ${PIDFILE}
	export HOME
	_update_active
	if  false ; then
	        echo "Starting transmission daemon ..." 
                transmissiond -p ${LISTENING_PORT}                 ${NAT_TRAVERSAL} 		-w ${WATCHDOG} 		-u ${UPLOAD_SPEED} 		-d ${DOWNLOAD_SPEED} 		-i ${PIDFILE}   ${ACTIVE}
	    sleep 5
	    if [ -f ${PIDFILE} ]; then
		PID=`cat ${PIDFILE}`
		echo "<p>Transmission daemon started with PID=${PID}</p>"
	    else
		echo "<p><b>Transmission daemon failed to start</b></p>" 
	    fi
	else
	  echo "<p>transmission_watchdog will start Transmission daemon.</p>"
          echo "<p>Press Watchdog button to force watchdog queue processing</p>"
	fi
    else
	touch "$WORK/.paused"
	kill -TERM `cat ${PIDFILE}`
	echo "<b>Stopping transmissison!</b>"
	echo "<p>Transmission will eventually stop. "
	echo "Last Log line should report transmissiond exiting.<p>"
    fi

}

  1. Update scrape info for active and downloaded torrents

_scrape () {

  for TORRENT in ${WORK}/*/*.torrent ${TARGET}/*/*.torrent* ; do
    INFO="${TORRENT%/*}/.info"
    if [ -f "${INFO}" ]; then
	. "${INFO}"
	SCRAPE=`transmissioncli -s "${TORRENT}" | grep seeder`
	DUMMY=$?
	_write_info
	if [ $DUMMY != 0 ]; then
	   echo "<p>${TORRENT} scrape failed</p>"
	fi
	UPLOADED=
	echo "."
    fi  
  done
  echo " done."

}

  1. Search for best done torrent and suggest seeding based on ratio
  2. Not very clever at the moment

_best_seed () {

   BEST=0              
    if [ -n "`ls ${TARGET}/*/*.torrent 2>/dev/null | head -n 1`" ] ; then
	for TORRENT in ${TARGET}/*/*.torrent ; do
	    INFO="${TORRENT%/*}/.info"
	    if [ -f "${INFO}" ]; then
		. "${INFO}"
		QUOTIENT=`echo "${SCRAPE}" | sed -n -e '/seeder/s/\([0-9]\{1,\}\) seeder(s), \([0-9]\{1,\}\) leecher.*/(\2000\/(\1+1)/p;d'` 
		RATIO=$((QUOTIENT))
		if [ ${RATIO} -gt ${BEST} ]; then
		    BESTTORRENT="${TORRENT}"
		    BESTSCRAPE="${SCRAPE}"
		    BEST=${RATIO}
		fi                                   
            fi       
	done 
	echo "<h3>Best seed suggestion</h3>"
	echo "<p>${BESTTORRENT##*/}</p>"
	echo "<p>${BESTSCRAPE}</p>"
   else                                                                
	echo "<b>No torrents to suggest for seeding</b>"
   fi                                       

}

  1. Fetch torrent from URL location given with FETCH

_fetch() {

    TORRENT=$(echo "${FETCH}" |sed 's/%/\\x/g')
    TORRENT=$(echo -e "${TORRENT}")
    echo "<p>Fetching ${TORRENT}</p>"
    wget -q -P ${SOURCE} "${TORRENT}"  ||  echo "<p>wget ${TORRENT} failed</p>"

}

  1. Sub for directory search

__find () {

    [ -n "${TORRENT}" ] && return

    FILEPAT="$1"
    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ] ; then
	for i in $FILEPAT ; do
	    if [ $ID = $idx ]; then
		TORRENT="$i"
  1. echo "Found $idx ${TORRENT}"
		return
	    fi
	    idx=$(($idx+1)) 
	done
    fi

}

  1. Search for torrent ID through directories. Must be in sync with _list()
  2. When found TORRENT is set. Should always find!

_find () {

    idx=0 
    TORRENT=""
    __find "$WORK/*/*.torrent"
    __find "$TARGET/*/*.torrent.seeding"
    __find "$WORK/*/*.torrent.suspended"
    __find "$WORK/*/*.torrent.removed"
    __find "$SOURCE/*.torrent"
    __find "$TARGET/*/*.torrent" 
   [ -z "${TORRENT}" ] && echo "Assertion failed [ -z TORRENT ] in _find()" 

}

__list () {

    FILEPAT="$1"
    DESC="$2"

    if [ -n "`ls ${FILEPAT} 2>/dev/null | head -n 1`" ]
    then
	echo "<table>"
	echo "<thead><tr><td></td><td>${DESC}</td><td>status</td></tr>"
	echo "</thead><tbody>"
	for i in $FILEPAT
	do
	    DUMMY="${i%.torrent*}"
	    P="${i%/*}"
	    DUMMY=${DUMMY##*/}
	    echo "<tr><td><input name=ID value=$idx type=radio></td>"
	    if [ -f "${P}/.info" ];then
	       . "${P}/.info" 
	    else
	       _clean_info
	    fi
	    TORRENT="$i"
	    if [ -n "${SETURL}" -a "${idx}" = "${ID}" ]; then
	       URL=$(echo "${SETURL}" | sed 's/%/\\x/g')
               URL=$(echo -e "${URL}")
	       _write_info
	       SETURL=
	    fi
	    if 	[ -f "${P}/.bypass" ] ; then
	   	echo -n "<td bgcolor=#a2b5cd>"
	    else
	    	echo -n "<td>"
	    fi
	    if [ -n "${URL}" ]; then
	       echo "<a href=\"${URL}\" target=_blank>${DUMMY}</a></td>"
	    else
	       echo "${DUMMY}</td>"
	    fi
	    if [ -f "$P/.info" ] ; then
		echo "<td>${STATUS}"
		echo " Start: ${STARTTIME}"
		[ -n "${ENDTIME}" ] && echo " End: ${ENDTIME}"
		[ -n "${SCRAPE}" ] && echo " ${SCRAPE}"
		if [ -n "${SETNOTE}" -a "${idx}" = "${ID}" ]; then
                   NOTE=$(echo "${SETNOTE}" | sed 's/%/\\x/g')
                   NOTE=$(echo -e "${NOTE}")
		   _write_info
		   SETNOTE=
		fi
		[ -n "${UPLOADED}" ] && echo " uploaded: ${UPLOADED} MB" 
		[ -n "${NOTE}" ] && echo " ${NOTE}"
		[ -f "${P}/.bypass" ] && echo ", bypassed"
		echo "</td></tr>"
	    fi
	    STARTTIME=
	    ENDTIME=
	    SCRAPE=
	    STATUS=
	    URL=
	    UPLOADED=
	    NOTE=
	    idx=`expr $idx + 1`
	done
	echo "</tbody></table>"
    echo
    fi

}

_list () {

    idx=0
    if [ -f "$WORK/.paused" ] ; then
	echo "<h3>Torrent processing paused!</h3>"
    fi
    __list "$WORK/*/*.torrent" "Active"
    __list "$TARGET/*/*.torrent.seeding" "Seeding"
    if [ -r "${SYSLOG}" ]; then
        SPEED=`tail ${SYSLOG}  | sed  -n '/transmissiond/s/.*\dl \([0-9.]\{1,\}\) ul \([0-9.]\{1,\}\).*/DOWNLOAD="\1";UPLOAD="\2"/p' | tail -1`
        eval "${SPEED}"
        if [ -n "${DOWNLOAD}"  ] ; then
	    echo "<table><tr><td>Total</td><td>Download ${DOWNLOAD}kB/s</td>"
	    echo "<td>Upload ${UPLOAD} kB/s</td></tr></table>"
        else
            echo "<p>Unable to find recent transfer stats in syslog</p>"
        fi
    else
        echo "<p>syslog: ${SYSLOG} unavailable for transfer stats!</p>"
    fi
    [ "${ACTION}" = "Update" ] && return
    __list "$WORK/*/*.torrent.suspended" "Suspended" 
    __list "$WORK/*/*.torrent.removed" "Removed" 
    __list "$SOURCE/*.torrent" "Queued"
    __list "$TARGET/*/*.torrent" "Done" 

}

_root_check () {

	if  [ ${USER} != admin -a  ${USER} != root ]; then
	    echo "You must be root! Because of killing stuff"
	    return 1
	fi
	return 0

}

  1. Mark torrent as removed. Purge will do cleanup

_remove () {

    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi

    _find

   if [ -f "${TORRENT%.torrent.suspended}.torrent.suspended" ]; then
	mv "${TORRENT}" "${TORRENT%.suspended}.removed"
   else
	echo "<b>Can only remove suspended torrents!</b>"
   fi

}

  1. Determine what to do? _resume|_suspend|_seed

_push() {

    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find

    if [ -f "${TORRENT%.suspended}.suspended" ]; then
       _resume
       return
    fi

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
       if [ -f "${TORRENT%.torrent}.torrent" ]; then
	    _suspend
   	    return
       fi
       # Removed ? Not pushed
    fi

    if [ -f "${TARGET}${TORRENT#${TARGET}}" ]; then
       _seed
       return
    fi 

    if [ -f "${SOURCE}${TORRENT#${SOURCE}}" ]; then
       _enqueue
       return
    fi

    echo "<p><em>Nothing to push!</em></p>" 

}

  1. Toggle bypass flag

_bypass() {

    if [ -z "$ID" ] ; then
	echo "<b>Please select active torrent first!</b>"
	return
    fi
    _find

    if [ -f "${WORK}${TORRENT#${WORK}}" ]; then
	DUMMY="${TORRENT%/*}/.bypass"
     	if [ -f "${DUMMY}" ]; then 
	    rm -f "${DUMMY}"
	else
	    echo "This torrent is bypassed by watchdog" > "${DUMMY}"
	fi
	return
    else
    	echo "<p> Can only bypass active torrent!</p>"
    fi

}

  1. Show transfer log from log file
  2. Replace "transmissiond" with "transmission" if all logs are preferred

_log () {

if [ ! -r ${SYSLOG} ]; then

  echo "<p>${SYSLOG} not readable. Properly configure syslogd at "
  echo "system startup.</p>"
  return

fi

echo "<pre>" sed -n -e "/ transmission.*:/{s/.*: \([0-9]\{1,10\}\) [0-9]\{1,\} dl \([0-9.]\{1,\}\) ul \([0-9.]\{1,\}\) ld \([0-9.]\{1,\}\)/\1 \2 -\3 \4/;t data;p;b;:data w ${GNUPLOT_DATA}" -e "}" ${SYSLOG} echo "</pre>"

if [ ! -x ${GNUPLOT} ]; then

  echo "<p>gnuplot: ${GNUPLOT} not found. Properly configure paths "
  echo "in transmission.conf for transfer graphing!</p>"
  return

fi

echo "<p>Creating graph...</p>" TZO=${TIMEZONE_OFFSET:-0} cat > ${GNUPLOT_COMMAND} << __EOF__ set terminal png small size 800,320 set output '${GNUPLOT_OUTPUT}' set xdata time set timefmt "%s" set format x "M\n%m/%d" set ytics nomirror set y2tics nomirror set y2range [0:] set ylabel "Transmission transfer rate [kB/s]" set y2label "System load (5 min average)" set y2tics 1 set xlabel "Time [UTC ${TZO} seconds]" plot '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):2 title 'download' axis x1y1 with impulses, '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):3 title 'upload' with impulses, '${GNUPLOT_DATA}' using (\$1+86400+${TZO}):4 axis x1y2 title 'load' with lines quit __EOF__

${GNUPLOT} ${GNUPLOT_COMMAND}

echo "<img src=\"${HTTP_IMG_LOCATION}\">"

}

_info () {

    if [ -z "$ID" ] ; then
	echo "<b>Please select torrent first!</b>"
	return
    fi
    _find
    echo "<h3>Torrent file metainfo</h3>"
    echo "<pre>"
    transmissioncli -i "${TORRENT}"
    echo "<p>"
    transmissioncli -s "${TORRENT}" | grep "seeder"
    echo "</p></pre>"

}

_help () {

    cat << __EOF__

This is quick explanation of the buttons: <dl> <dt><u>U</u>pdate<dd>updates active torrents status <dt><u>P</u>ush<dd> Push selected torrent to other queue <dt>Log<dd>shows <u>c</u>urrent transfer log graph <dt><u>L</u>ist<dd>lists queued, active, suspended and completed torrents <dt>U<u>R</u>L<dd>Enter URL location for torrent <dt><u>N</u>ote<dd>Append your notes to torrent status <dt>B<u>y</u>pass<dd>Bypass active torrent watchdog processing <dt>Pur<u>g</u>e<dd>removes all logs from completed torrents and clean removed torrents <dt><u>W</u>atchdog<dd>forces transmission_watchdog processing <dt>Pau<u>s</u>e<dd>all active torrent processing should stop/resume imediately <dt><u>R</u>emove<dd>mark torrent for purging <dt><u>I</u>nfo<dd>shows selected torrent info (file content and size) <dt>Scr<u>a</u>pe<dd>Update scrape info (seeders, leechers, downloaded)

     from tracker for downloaded torrents

<dt><u>B</u>est<dd>Search scrape for best done torrent and suggest seeding based on (leeches/seeds) ratio <dt><u>F</u>etch<dd>Fetch torrent file from URL (link location) <dt><u>H</u>elp<dd> Access keys <u>underlined</u>! Use Alt-Key for access. Button listing in descending importance. </dl>

<p>Explanation of usage is available at NSLU2 Optware <a href=http://www.nslu2-linux.org/wiki/Optware/Transmission> Transmission daemon wiki page</a>.</p>

__EOF__ if [ -r /opt/share/doc/transmission/README.daemon ]; then

	echo "<pre>" 
	cat /opt/share/doc/transmission/README.daemon
	echo "</pre>" 

fi _root_check }

  1. MAIN PROCESS

cat << __EOF__ Content-type: text/html

<html> <head>

  <title>Transmission</title>
  <style type="text/css">
  <!--
      BODY { background-color: #F8F4E7?; color: #552800 }
      A:link { color: #0000A0 }
      A:visited { color: #A000A0? }
      THEAD {
        background: #D0D0D0?;
        color: #000000;
        text-align: center;
      }
      TBODY {
        background: #D0D0E7?;
      }
   //-->
  </style>

</head> <body> <form action=transmission.cgi method=get> <input type=submit accesskey=u name=ACTION value=Update> <input type=submit accesskey=p name=ACTION value=Push> <input type=submit accesskey=l name=ACTION value=List> <input type=submit accesskey=c name=ACTION value=Log> <input type=submit accesskey=r name=SETURL value=URL

 onClick='value=prompt("Enter URL location to torrent page", "http://")'>

<input type=submit accesskey=n name=SETNOTE value=Note

 onClick='value=prompt("Enter your notes for this torrent")'>

<input type=submit accesskey=y name=ACTION value=Bypass> <input type=submit accesskey=s name=ACTION value=Pause> <input type=submit accesskey=w name=ACTION value=Watchdog> <input type=submit accesskey=r name=ACTION value=Remove> <input type=submit accesskey=g name=ACTION value=Purge> <input type=submit accesskey=i name=ACTION value=Info> <input type=submit accesskey=a name=ACTION value=Scrape> <input type=submit accesskey=b name=ACTION value=Best> <input type=submit accesskey=f name=FETCH value=Fetch onClick='value=prompt("Enter torrent link location for fetching")'> <input type=submit accesskey=h name=ACTION value=Help> <! img align=top alt="" src=pingvin.gif> <br>

__EOF__

QUERY_STRING=`echo "$QUERY_STRING" | sed 's/&/;/g'` eval ${QUERY_STRING}

  1. export ACTION
  2. /opt/bin/printenv
  3. set

[ -n "${FETCH}" ] && _fetch

case "${ACTION}" in

    Update)	_update_progress ; _list ;;
    Log)	_log ;;
    Push)	_push ; _list ;;
    Pause)	_pause ; _list ;;
    Remove)	_remove; _list ;;
    Purge)	_purge ;;
    Watchdog)	transmission_watchdog ;;
    Info)	_info ;;
    Help)	_help ;;
    Scrape)	_scrape ; _list;;
    Best)	_best_seed ; _list;;
    Bypass)	_bypass; _list ;;
    *) _list ;;

esac

echo "<p>" ; ps ; free ; echo "</p>"

cat << __EOF__ </form>

<h3>Links</h3> <ul>

  <li><a href=../source>source</a></li>
  <li><a href=../work>work</a></li>
  <li><a href=../target>target</a></li>

</ul> <hr> <address> © 2005-2007 oleo </address> </body> </html> __EOF__

You can create softlinks (ln -s ...) from /home/httpd/html to your source, work and target directory.

Adjusted transmission.conf

This file is located in /opt/etc/ Warning: adjust the locations for SOURCE, WORK and TARGET according to your wishes. The same for PIDFILE, ACTIVE and HOME. Also change the LISTENING_PORT if you need to (depending on your firewall-settings)

  1. Configuration
  2. NOTE: no spaces around the = sign
  3. the config will be sourced (eg. . transmission.conf)

SOURCE=/share/hdd/data/Torrents/Source WORK=/share/hdd/data/Torrents/Work TARGET=/share/hdd/data/Torrents/Target

  1. MAILTO=torrent@somedomain.com
  2. MAILFROM=torrent@somedomain.com

MAILOPT="-smail.somedomain.com -f" USER=root GROUP=root DATE_FORMAT="h M"

  1. Transmission daemon variables

PIDFILE=/share/hdd/data/Torrents/TMP/transmission.pid ACTIVE=/share/hdd/data/Torrents/TMP/active-torrents.txt HOME=/share/hdd/data/Torrents/TMP/ WATCHDOG=300 LISTENING_PORT=4656

  1. set SPEED in kB/s or -1 for unlimited

UPLOAD_SPEED=41 DOWNLOAD_SPEED=180

  1. UPLOAD_SPEED=41
  2. DOWNLOAD_SPEED=180
  3. change SYSLOG from /tmp/syslog.log to

SYSLOG=/var/log/messages

  1. Uncomment the following for UPNP NAT traversal
  2. NAT_TRAVERSAL=--nat-traversal
  3. Seed torrent after completition (YES or NO)

AUTOSEED="YES"

  1. If the following limit is reached watchdog will not enqueue new one

MAX_ACTIVE_TORRENTS=10

  1. Creating graphical log of transfer with gnuplot
  2. can be very site specific issue. See transmission.cgi
  3. how this variables are used.

GNUPLOT=/opt/bin/gnuplot GNUPLOT_COMMAND=${WORK}/transfer.gnuplot GNUPLOT_DATA=${WORK}/transfer.data GNUPLOT_OUTPUT=/home/httpd/html/transfer.png HTTP_IMG_LOCATION=../transfer.png

  1. TZ offset in seconds. Use +- sign. DST manually

TIMEZONE_OFFSET=+3600

  1. Colors for command line. # comment out if not needed

GREEN="\033[32;1m"

  1. NC="\033[0m"
  2. BACK_UP="\033[1K\033[0G"

NORMAL="\033[0m" WARN="\033[33;1m" BAD="\033[31;1m" BOLD="\033[1m" GOOD="\033[32;1m"

Remove S80busybox_httpd

This file is located in /opt/etc/init.d.

Adjust crontab

In /opt/etc/ edit the line in crontab which references to transmission_watchdog: admin must be replaced by root

March 01, 2007, at 02:15 PM by oleo -- formatting
Changed lines 294-311 from:

Code: ipkg install mc ipkg install xinetd ipkg install samba2Create folder for samba shares

Code: mkdir /mnt/share chmod ugoa+w /mnt/shareCreate rc.unslung (if you want to start all your services automatically after each reboot)

Code: nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:

Code:

  1. Start all init scripts in /opt/etc/init.d
  2. executing them in numerical order.

for i in /opt/etc/init.d/S??* ;do

to:
 ipkg install mc
 ipkg install xinetd
 ipkg install samba2

Create folder for samba shares

 mkdir /mnt/share
 chmod ugoa+w /mnt/shareCreate rc.unslung 

(if you want to start all your services automatically after each reboot)

 nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:


 # Start all init scripts in /opt/etc/init.d
 # executing them in numerical order.
 #
 for i in /opt/etc/init.d/S??* ;do 
Changed lines 330-334 from:

done

Edit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid. Make rc.unslung executable, and execute it to start xinetd and samba2

to:
 done

 Edit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid.
 Make rc.unslung executable, and execute it to start xinetd and samba2
Changed lines 336-339 from:
 /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed  all shares and created two new ones:
  • Share (pointing to /mnt/share)

- Torrent (pointing to /mnt/torrent)

to:
 /opt/etc/init.d/rc.unslung

Open your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:

 * Share (pointing to /mnt/share)
 - Torrent (pointing to /mnt/torrent)
Changed lines 349-350 from:
 ipkg install libbtCreate torrent directories
to:

Create torrent directories

Changed lines 378-379 from:

nano /opt/etc/init.d/S05syslogd

to:
 nano /opt/etc/init.d/S05syslogd
Changed lines 396-397 from:
 You can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi
to:
 You can access Transmission from Windows pointing your browser to    http://192.168.1.1:8008/cgi-bin/transmission.cgi
February 23, 2007, at 01:37 PM by fcarolo -- formatted link
Changed lines 392-393 from:
 You can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi
to:
 You can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi
February 23, 2007, at 08:20 AM by oleo -- fmt
Added lines 156-158:

by Moody Blue

Changed lines 329-331 from:

doneEdit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid.

to:

done

Edit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid.

Changed lines 334-337 from:

Code: chmod +x /opt/etc/init.d/rc.unslung /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones: - Share (pointing to /mnt/share)

to:
 chmod +x /opt/etc/init.d/rc.unslung
 /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed  all shares and created two new ones:
  • Share (pointing to /mnt/share)
Changed lines 338-339 from:

Step4 - Install Tranmission

to:

Step 4 - Install Tranmission

Changed lines 342-358 from:

Code: ipkg install cron ipkg install gnuplot ipkg install logrotate ipkg install transmission ipkg install libbtCreate torrent directories

Code: mkdir /mnt/torrent mkdir /mnt/torrent/source mkdir /mnt/torrent/target mkdir /mnt/torrent/work chmod ugoa+w /mnt/torrent chmod ugoa+w /mnt/torrent/source chmod ugoa+w /mnt/torrent/target chmod ugoa+w /mnt/torrent/workUsing mc, edit /opt/etc/transmission.conf and replace all tmp/harddisk by mnt. Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

to:
 ipkg install cron
 ipkg install gnuplot
 ipkg install logrotate
 ipkg install transmission
 ipkg install libbtCreate torrent directories

 mkdir /mnt/torrent
 mkdir /mnt/torrent/source
 mkdir /mnt/torrent/target
 mkdir /mnt/torrent/work
 chmod ugoa+w /mnt/torrent
 chmod ugoa+w /mnt/torrent/source
 chmod ugoa+w /mnt/torrent/target
 chmod ugoa+w /mnt/torrent/work

Using mc, edit /opt/etc/transmission.conf and replace all tmp/harddisk by mnt. Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

Changed lines 364-397 from:

Code: SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin MAILTO="" HOME=/

  1. ---------- ---------- Default is Empty ---------- ---------- #
  • /30 * * * * xxxx nice /opt/sbin/transmission_watchdog

0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/nullCreate S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.

Code: nano /opt/etc/init.d/S05syslogdHere? is mine:

Code:

  1. !/bin/sh
  2. Startup script for syslogd
  3. Stop myself if running

if [ -n "`pidof syslogd`" ]; then killall syslogd 2>/dev/null fi

/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:

Code: chmod +x /opt/etc/init.d/S05syslogd rebootYou can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi Next Steps (optional) 1) Access router from WAN: - Activate Dropbear (see initial post of this thread) - In the web interface disable Telnet and enable DynDNS - Create two entries in putty, one for LAN, another for WAN access - Implement SSL security as discussed here

to:
 SHELL=/bin/sh
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
 MAILTO=""
 HOME=/
 # ---------- ---------- Default is Empty ---------- ---------- #
 */30 * * * * xxxx nice /opt/sbin/transmission_watchdog
 0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null

Create S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.

nano /opt/etc/init.d/S05syslogd

Here is mine:

 #!/bin/sh
 #
 # Startup script for syslogd
 #
 # Stop myself if running
 if [ -n "`pidof syslogd`" ]; then
   killall syslogd 2>/dev/null
 fi

 /sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:

 chmod +x /opt/etc/init.d/S05syslogd
 reboot

 You can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi
 Next Steps (optional)

Access router from WAN:

  1. Activate Dropbear (see initial post of this thread)
  2. In the web interface disable Telnet and enable DynDNS
  3. Create two entries in putty, one for LAN, another for WAN access
  4. Implement SSL security as discussed here
February 23, 2007, at 08:14 AM by oleo -- formatting
February 23, 2007, at 08:14 AM by oleo -- formatting
February 23, 2007, at 08:13 AM by oleo -- formatting
Changed lines 158-171 from:

Step 1 - Install required HW and SW 1) Connect your PC to the wl-500gP using an ethernet cable (you should not use wireless during Step 1), and make sure that you can connect to the Ethernet 2) Download and install putty and ASUS fw restoration utility 3) Download Oleg 1.9.2.7-7f firmware 4) Unplug all USB devices from the router, and disconnect the modem cable 5) Using the web interface, reset the router to factory settings 6) Put the router in restoration mode 7) Start ASUS firmware restoration utility and load Oleg fw into the router. Do not interrupt this step, the router may have to be repaired or replaced if you interrupt the load. The router will reboot automatically 8) Connect the modem cable, and parametrize the router using web interface (at this stage the userid/password is admin/admin). Here are some of my parameters: - Maintain 192.168.1.1 as the router's IP address, and limit DHCP to 192.168.1.2/24 - Deactivate ftp and samba - Allow ping from WAN side - Activate Telnet service - If you use wireless, select 32mW as the transmission power and activate the maximum possible security supported by your PC's (in my case WEP128? + mac access + hide SSID)

to:

Step 1 - Install required HW and SW

  1. ) Connect your PC to the wl-500gP using an ethernet cable (you should not use wireless during Step 1), and make sure that you can connect to the Ethernet
  2. ) Download and install putty and ASUS fw restoration utility
  3. ) Download Oleg 1.9.2.7-7f firmware
  4. ) Unplug all USB devices from the router, and disconnect the modem cable
  5. ) Using the web interface, reset the router to factory settings
  6. ) Put the router in restoration mode
  7. ) Start ASUS firmware restoration utility and load Oleg fw into the router. Do not interrupt this step, the router may have to be repaired or replaced if you interrupt the load. The router will reboot automatically
  8. ) Connect the modem cable, and parametrize the router using web interface (at this stage the userid/password is admin/admin). Here are some of my parameters:
  • Maintain 192.168.1.1 as the router's IP address, and limit DHCP to 192.168.1.2/24
  • Deactivate ftp and samba
  • Allow ping from WAN side
  • Activate Telnet service
  • If you use wireless, select 32mW as the transmission power and activate the maximum possible security supported by your PC's (in my case WEP128? + mac access + hide SSID)
Changed line 174 from:

9) Reboot the router (using web interface)

to:
  1. ) Reboot the router (using web interface)
Changed lines 176-178 from:

Step 2 - Prepare the disk

to:

Step 2 - Prepare the disk

Changed lines 180-183 from:

1) Connect the disk to the router 2) Start putty in Windows (all the remaining actions should be performed in line mode, not web interface). Point it to 192.168.1.1, telnet, keyboard with Linux function keys 3) Format the disk with 3 primary partitions, first with +512M for swap (select type 82), second with +1G (for /opt), and 3rd for the rest (for /mnt). Use fdisk help to guide you.

to:
  1. ) Connect the disk to the router
  2. ) Start putty in Windows (all the remaining actions should be performed in line mode, not web interface). Point it to 192.168.1.1, telnet, keyboard with Linux function keys
  3. ) Format the disk with 3 primary partitions, first with +512M for swap (select type 82), second with +1G (for /opt), and 3rd for the rest (for /mnt). Use fdisk help to guide you.
    insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s fdisk /dev/discs/disc0/disc4) Reboot
    reboot
  4. ) Format and mount the disk
    insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s mkswap /dev/discs/disc0/part1 swapon /dev/discs/disc0/part1 mke2fs -j /dev/discs/disc0/part2 mount /dev/discs/disc0/part2 /opt mke2fs -j /dev/discs/disc0/part3 mount /dev/discs/disc0/part3 /mnt7) Install base packages (ignore errors regarding wl500g):
    cd /opt/ mkdir /opt/tmp mkdir /opt/tmp/ipkg wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk ipkg update ipkg install nano rm *.ipk8) Create startup scripts
    mkdir -p /usr/local/sbin nano /usr/local/sbin/post-bootHere is my post-boot file:
    1. !/bin/sh
    2. test if USB disc has been attached
    3. if not - then insert needed modules
    if [ ! -d /dev/discs ]
     then
       insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
     fi 
  1. ) Wait for /opt to mount mount /dev/discs/disc0/part2 /opt mount /dev/discs/disc0/part3 /mnt
    i=0
  while [ $i -le 30 ]
    do
     if [ -d /opt/etc ]
      then
       break
    fi
sleep 1
 i=`expr $i + 1`
    done
  1. ) Activate swap swapon /dev/discs/disc0/part1
  2. to let midnight commander run on terminals, make alias for colored mc echo "export TERMINFO=/opt/share/terminfo">>/etc/profile echo "alias mc=\"mc -c\"">>/etc/profile
  3. Run all active services - active means starts with S
 /opt/etc/init.d/rc.unslungNext let's create the post-firewall file
Changed lines 248-250 from:

insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s fdisk /dev/discs/disc0/disc4) Reboot

to:

nano /usr/local/sbin/post-firewallHere is my post-firewall

Changed lines 251-252 from:

reboot5) Format and mount the disk

to:
  1. !/bin/sh
    1. FIREWALL
    2. set default policy

iptables -P INPUT DROP

  1. deny ftp access from WAN

iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP

  1. Allow access to various router services from WAN
  2. Remove 22 8008 and 901 if you don't want to logon from WAN

for P in 65534 22 8008 901; do

  iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT

doneCreate remaining files:

Changed lines 264-271 from:

insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s mkswap /dev/discs/disc0/part1 swapon /dev/discs/disc0/part1 mke2fs -j /dev/discs/disc0/part2 mount /dev/discs/disc0/part2 /opt mke2fs -j /dev/discs/disc0/part3 mount /dev/discs/disc0/part3 /mnt7) Install base packages (ignore errors regarding wl500g):

to:

touch /usr/local/sbin/post-mount touch /usr/local/sbin/pre-shutdown chmod +x /usr/local/sbin/*9) Save to flash and reboot

Changed lines 269-279 from:

cd /opt/ mkdir /opt/tmp mkdir /opt/tmp/ipkg wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk ipkg update ipkg install nano rm *.ipk8) Create startup scripts

to:

flashfs save && flashfs commit && flashfs enable && rebootAt the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this with

Changed lines 272-274 from:

mkdir -p /usr/local/sbin nano /usr/local/sbin/post-bootHere is my post-boot file:

to:

mount freeThis should produce an output similar to

Changed lines 276-308 from:
  1. !/bin/sh
  2. test if USB disc has been attached
  3. if not - then insert needed modules

if [ ! -d /dev/discs ]

    then

insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s

    fi
  1. Wait for /opt to mount

mount /dev/discs/disc0/part2 /opt mount /dev/discs/disc0/part3 /mnt

    i=0

while [ $i -le 30 ]

    do

if [ -d /opt/etc ]

    then
    break
    fi

sleep 1 i=`expr $i + 1`

    done
  1. Activate swap

swapon /dev/discs/disc0/part1

  1. to let midnight commander run on terminals, make alias for colored mc

echo "export TERMINFO=/opt/share/terminfo">>/etc/profile echo "alias mc=\"mc -c\"">>/etc/profile

  1. Run all active services - active means starts with S

/opt/etc/init.d/rc.unslungNext let's create the post-firewall file

to:

[xxxx@MyASUS? root]$ mount /dev/root on / type squashfs (ro) none on /dev type devfs (rw) proc on /proc type proc (rw) ramfs on /tmp type ramfs (rw) usbfs on /proc/bus/usb type usbfs (rw) /dev/discs/disc0/part2 on /opt type ext3 (rw) /dev/discs/disc0/part3 on /mnt type ext3 (rw) [xxxx@MyASUS? root]$ free

              total         used         free       shared      buffers
  Mem:        30140        13744        16396            0         4148
 Swap:       500712            0       500712

Total: 530852 13744 517108Step3 - Install samba2 Samba2 comes with a web interface from where you can parametrize and restart the service without rebooting the router. It was my choice to have file server services provided by the router.

Changed lines 292-293 from:

nano /usr/local/sbin/post-firewallHere is my post-firewall

to:

ipkg install mc ipkg install xinetd ipkg install samba2Create folder for samba shares

Changed lines 297-308 from:
  1. !/bin/sh
    1. FIREWALL
    2. set default policy

iptables -P INPUT DROP

  1. deny ftp access from WAN

iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP

  1. Allow access to various router services from WAN
  2. Remove 22 8008 and 901 if you don't want to logon from WAN

for P in 65534 22 8008 901; do

  iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT

doneCreate remaining files:

to:

mkdir /mnt/share chmod ugoa+w /mnt/shareCreate rc.unslung (if you want to start all your services automatically after each reboot)

Changed lines 301-304 from:

touch /usr/local/sbin/post-mount touch /usr/local/sbin/pre-shutdown chmod +x /usr/local/sbin/*9) Save to flash and reboot

to:

nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:

Changed lines 304-305 from:

flashfs save && flashfs commit && flashfs enable && rebootAt the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this with

to:
  1. Start all init scripts in /opt/etc/init.d
  2. executing them in numerical order.

for i in /opt/etc/init.d/S??* ;do

    # Ignore dangling symlinks (if any).
    [ ! -f "$i" ] && continue

    case "$i" in
       *.sh)
           # Source shell script for speed.
           (
               trap - INT QUIT TSTP
               set start
               . $i
           )
           ;;
       *)
           # No sh extension, so fork subprocess.
           $i start
           ;;
   esac

doneEdit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid. Make rc.unslung executable, and execute it to start xinetd and samba2

Changed lines 330-332 from:

mount freeThis should produce an output similar to

to:

chmod +x /opt/etc/init.d/rc.unslung /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones: - Share (pointing to /mnt/share) - Torrent (pointing to /mnt/torrent) Step4 - Install Tranmission This was my choice for torrent client. It's Very easy to use. You can either store .torrent files in //myasus/torrent/source or use Transmission's fetch button. At the moment transmission is going through changes, so what follows may not apply in the near future.

Changed lines 338-352 from:

[xxxx@MyASUS? root]$ mount /dev/root on / type squashfs (ro) none on /dev type devfs (rw) proc on /proc type proc (rw) ramfs on /tmp type ramfs (rw) usbfs on /proc/bus/usb type usbfs (rw) /dev/discs/disc0/part2 on /opt type ext3 (rw) /dev/discs/disc0/part3 on /mnt type ext3 (rw) [xxxx@MyASUS? root]$ free

              total         used         free       shared      buffers
  Mem:        30140        13744        16396            0         4148
 Swap:       500712            0       500712

Total: 530852 13744 517108Step3 - Install samba2 Samba2 comes with a web interface from where you can parametrize and restart the service without rebooting the router. It was my choice to have file server services provided by the router.

to:

ipkg install cron ipkg install gnuplot ipkg install logrotate ipkg install transmission ipkg install libbtCreate torrent directories

Changed lines 345-348 from:

ipkg install mc ipkg install xinetd ipkg install samba2Create folder for samba shares

to:

mkdir /mnt/torrent mkdir /mnt/torrent/source mkdir /mnt/torrent/target mkdir /mnt/torrent/work chmod ugoa+w /mnt/torrent chmod ugoa+w /mnt/torrent/source chmod ugoa+w /mnt/torrent/target chmod ugoa+w /mnt/torrent/workUsing mc, edit /opt/etc/transmission.conf and replace all tmp/harddisk by mnt. Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

In case your admin userid was changed to something else, pls edit /opt/share/www/cgi-bin/transmission.cgi accordingly.

Edit your opt/etc/crontab file. Mine is (replace xxxx with your admin userid):

Changed lines 359-361 from:

mkdir /mnt/share chmod ugoa+w /mnt/shareCreate rc.unslung (if you want to start all your services automatically after each reboot)

to:

SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin MAILTO="" HOME=/

  1. ---------- ---------- Default is Empty ---------- ---------- #
  • /30 * * * * xxxx nice /opt/sbin/transmission_watchdog

0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/nullCreate S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.

Changed lines 368-369 from:

nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:

to:

nano /opt/etc/init.d/S05syslogdHere? is mine:

Changed lines 371-372 from:
  1. Start all init scripts in /opt/etc/init.d
  2. executing them in numerical order.
to:
  1. !/bin/sh
Changed lines 373-394 from:

for i in /opt/etc/init.d/S??* ;do

    # Ignore dangling symlinks (if any).
    [ ! -f "$i" ] && continue

    case "$i" in
       *.sh)
           # Source shell script for speed.
           (
               trap - INT QUIT TSTP
               set start
               . $i
           )
           ;;
       *)
           # No sh extension, so fork subprocess.
           $i start
           ;;
   esac

doneEdit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid. Make rc.unslung executable, and execute it to start xinetd and samba2

to:
  1. Startup script for syslogd
  2. Stop myself if running

if [ -n "`pidof syslogd`" ]; then killall syslogd 2>/dev/null fi

/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:

Deleted lines 382-434:

chmod +x /opt/etc/init.d/rc.unslung /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones: - Share (pointing to /mnt/share) - Torrent (pointing to /mnt/torrent) Step4 - Install Tranmission This was my choice for torrent client. It's Very easy to use. You can either store .torrent files in //myasus/torrent/source or use Transmission's fetch button. At the moment transmission is going through changes, so what follows may not apply in the near future.

Code: ipkg install cron ipkg install gnuplot ipkg install logrotate ipkg install transmission ipkg install libbtCreate torrent directories

Code: mkdir /mnt/torrent mkdir /mnt/torrent/source mkdir /mnt/torrent/target mkdir /mnt/torrent/work chmod ugoa+w /mnt/torrent chmod ugoa+w /mnt/torrent/source chmod ugoa+w /mnt/torrent/target chmod ugoa+w /mnt/torrent/workUsing mc, edit /opt/etc/transmission.conf and replace all tmp/harddisk by mnt. Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

In case your admin userid was changed to something else, pls edit /opt/share/www/cgi-bin/transmission.cgi accordingly.

Edit your opt/etc/crontab file. Mine is (replace xxxx with your admin userid):

Code: SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin MAILTO="" HOME=/

  1. ---------- ---------- Default is Empty ---------- ---------- #
  • /30 * * * * xxxx nice /opt/sbin/transmission_watchdog

0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/nullCreate S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.

Code: nano /opt/etc/init.d/S05syslogdHere? is mine:

Code:

  1. !/bin/sh
  2. Startup script for syslogd
  3. Stop myself if running

if [ -n "`pidof syslogd`" ]; then killall syslogd 2>/dev/null fi

/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:

Code:

February 23, 2007, at 07:18 AM by oleo -- oleg fw -- needs formating
Added lines 154-393:

Oleg firmware and Transmission

My objective was to setup Oleg 1.9.2.7-7f with Transmission and Samba2. This guide is written supposing that your PC runs Windows, and you want to use your router as a file server (to schedule backups, for example) and Torrent client. Step 1 - Install required HW and SW 1) Connect your PC to the wl-500gP using an ethernet cable (you should not use wireless during Step 1), and make sure that you can connect to the Ethernet 2) Download and install putty and ASUS fw restoration utility 3) Download Oleg 1.9.2.7-7f firmware 4) Unplug all USB devices from the router, and disconnect the modem cable 5) Using the web interface, reset the router to factory settings 6) Put the router in restoration mode 7) Start ASUS firmware restoration utility and load Oleg fw into the router. Do not interrupt this step, the router may have to be repaired or replaced if you interrupt the load. The router will reboot automatically 8) Connect the modem cable, and parametrize the router using web interface (at this stage the userid/password is admin/admin). Here are some of my parameters: - Maintain 192.168.1.1 as the router's IP address, and limit DHCP to 192.168.1.2/24 - Deactivate ftp and samba - Allow ping from WAN side - Activate Telnet service - If you use wireless, select 32mW as the transmission power and activate the maximum possible security supported by your PC's (in my case WEP128? + mac access + hide SSID) - In LAN IP Setting / Host name specify a hostname of your choice (mine is MyASUS?) 9) Reboot the router (using web interface) You may have to calibrate the wireless part (it took me about 2 weeks to reach an acceptable setup) Step 2 - Prepare the disk From now on you can use wireless if you want. 1) Connect the disk to the router 2) Start putty in Windows (all the remaining actions should be performed in line mode, not web interface). Point it to 192.168.1.1, telnet, keyboard with Linux function keys 3) Format the disk with 3 primary partitions, first with +512M for swap (select type 82), second with +1G (for /opt), and 3rd for the rest (for /mnt). Use fdisk help to guide you.

Code: insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s fdisk /dev/discs/disc0/disc4) Reboot

Code: reboot5) Format and mount the disk

Code: insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s mkswap /dev/discs/disc0/part1 swapon /dev/discs/disc0/part1 mke2fs -j /dev/discs/disc0/part2 mount /dev/discs/disc0/part2 /opt mke2fs -j /dev/discs/disc0/part3 mount /dev/discs/disc0/part3 /mnt7) Install base packages (ignore errors regarding wl500g):

Code: cd /opt/ mkdir /opt/tmp mkdir /opt/tmp/ipkg wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk ipkg update ipkg install nano rm *.ipk8) Create startup scripts

Code: mkdir -p /usr/local/sbin nano /usr/local/sbin/post-bootHere is my post-boot file:

Code:

  1. !/bin/sh
  2. test if USB disc has been attached
  3. if not - then insert needed modules

if [ ! -d /dev/discs ]

    then

insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s

    fi
  1. Wait for /opt to mount

mount /dev/discs/disc0/part2 /opt mount /dev/discs/disc0/part3 /mnt

    i=0

while [ $i -le 30 ]

    do

if [ -d /opt/etc ]

    then
    break
    fi

sleep 1 i=`expr $i + 1`

    done
  1. Activate swap

swapon /dev/discs/disc0/part1

  1. to let midnight commander run on terminals, make alias for colored mc

echo "export TERMINFO=/opt/share/terminfo">>/etc/profile echo "alias mc=\"mc -c\"">>/etc/profile

  1. Run all active services - active means starts with S

/opt/etc/init.d/rc.unslungNext let's create the post-firewall file

Code: nano /usr/local/sbin/post-firewallHere is my post-firewall

Code:

  1. !/bin/sh
    1. FIREWALL
    2. set default policy

iptables -P INPUT DROP

  1. deny ftp access from WAN

iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP

  1. Allow access to various router services from WAN
  2. Remove 22 8008 and 901 if you don't want to logon from WAN

for P in 65534 22 8008 901; do

  iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT

doneCreate remaining files:

Code: touch /usr/local/sbin/post-mount touch /usr/local/sbin/pre-shutdown chmod +x /usr/local/sbin/*9) Save to flash and reboot

Code: flashfs save && flashfs commit && flashfs enable && rebootAt the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this with

Code: mount freeThis should produce an output similar to

Code: [xxxx@MyASUS? root]$ mount /dev/root on / type squashfs (ro) none on /dev type devfs (rw) proc on /proc type proc (rw) ramfs on /tmp type ramfs (rw) usbfs on /proc/bus/usb type usbfs (rw) /dev/discs/disc0/part2 on /opt type ext3 (rw) /dev/discs/disc0/part3 on /mnt type ext3 (rw) [xxxx@MyASUS? root]$ free

              total         used         free       shared      buffers
  Mem:        30140        13744        16396            0         4148
 Swap:       500712            0       500712

Total: 530852 13744 517108Step3 - Install samba2 Samba2 comes with a web interface from where you can parametrize and restart the service without rebooting the router. It was my choice to have file server services provided by the router.

Code: ipkg install mc ipkg install xinetd ipkg install samba2Create folder for samba shares

Code: mkdir /mnt/share chmod ugoa+w /mnt/shareCreate rc.unslung (if you want to start all your services automatically after each reboot)

Code: nano /opt/etc/init.d/rc.unslungHere is my rc.unslung file:

Code:

  1. Start all init scripts in /opt/etc/init.d
  2. executing them in numerical order.

for i in /opt/etc/init.d/S??* ;do

    # Ignore dangling symlinks (if any).
    [ ! -f "$i" ] && continue

    case "$i" in
       *.sh)
           # Source shell script for speed.
           (
               trap - INT QUIT TSTP
               set start
               . $i
           )
           ;;
       *)
           # No sh extension, so fork subprocess.
           $i start
           ;;
   esac

doneEdit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid. Make rc.unslung executable, and execute it to start xinetd and samba2

Code: chmod +x /opt/etc/init.d/rc.unslung /opt/etc/init.d/rc.unslungOpen your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones: - Share (pointing to /mnt/share) - Torrent (pointing to /mnt/torrent) Step4 - Install Tranmission This was my choice for torrent client. It's Very easy to use. You can either store .torrent files in //myasus/torrent/source or use Transmission's fetch button. At the moment transmission is going through changes, so what follows may not apply in the near future.

Code: ipkg install cron ipkg install gnuplot ipkg install logrotate ipkg install transmission ipkg install libbtCreate torrent directories

Code: mkdir /mnt/torrent mkdir /mnt/torrent/source mkdir /mnt/torrent/target mkdir /mnt/torrent/work chmod ugoa+w /mnt/torrent chmod ugoa+w /mnt/torrent/source chmod ugoa+w /mnt/torrent/target chmod ugoa+w /mnt/torrent/workUsing mc, edit /opt/etc/transmission.conf and replace all tmp/harddisk by mnt. Also replace USER=admin by your correct userid, and update TIMEZONE if needed.

In case your admin userid was changed to something else, pls edit /opt/share/www/cgi-bin/transmission.cgi accordingly.

Edit your opt/etc/crontab file. Mine is (replace xxxx with your admin userid):

Code: SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin MAILTO="" HOME=/

  1. ---------- ---------- Default is Empty ---------- ---------- #
  • /30 * * * * xxxx nice /opt/sbin/transmission_watchdog

0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/nullCreate S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.

Code: nano /opt/etc/init.d/S05syslogdHere? is mine:

Code:

  1. !/bin/sh
  2. Startup script for syslogd
  3. Stop myself if running

if [ -n "`pidof syslogd`" ]; then killall syslogd 2>/dev/null fi

/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7Make it executable, and reboot:

Code: chmod +x /opt/etc/init.d/S05syslogd rebootYou can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgi Next Steps (optional) 1) Access router from WAN: - Activate Dropbear (see initial post of this thread) - In the web interface disable Telnet and enable DynDNS - Create two entries in putty, one for LAN, another for WAN access - Implement SSL security as discussed here

February 15, 2007, at 08:50 PM by fcarolo -- formatting and cleanup
Changed lines 10-11 from:
  • WWW interface transmission.cgi can be public (no password) as
   there is no delete provided.
to:
  • WWW interface transmission.cgi can be public (no password) as there is no delete provided.
Changed lines 66-74 from:

Accessing/Uploading .torrent files:
You can do this either via fetch method thats available while viewing transmission.cgi (no cookie support!) and also with ftp and samba.
I prefer the ftp way since its locked with pass and very easy to start you only need to install vsftpd : \\

 >ipkg install vsftpd \\ 

Login details are set to your root login and pass by deafault.
For samba you need to try it our urself. Wiki : http://wiki.openwrt.org/SambaHowto?highlight=%28samba%29

to:

Accessing/Uploading .torrent files

You can do this either via fetch method that's available while viewing transmission.cgi (no cookie support!) and also with ftp and samba.

I prefer the ftp way since its locked with pass and very easy to start you only need to install vsftpd:
ipkg install vsftpd

Login details are set to your root login and pass by default.

For samba you need to try it yourself. Wiki: http://wiki.openwrt.org/SambaHowto?highlight=%28samba%29

Changed lines 107-109 from:
  • Bypass: this will mark active torrent to be bypasswd by watchdow when it tries to enqueue
 new torrents from source. Use this for big and slow torrents that will be bypasswd by others.
to:
  • Bypass: this will mark active torrent to be bypasswd by watchdow when it tries to enqueue new torrents from source. Use this for big and slow torrents that will be bypasswd by others.
Changed lines 125-143 from:

WAN Access

In order to make the torrent client pass your firewall you MUST open the torrent port to be "connectable" the other ports are options if you want to access your router from some other WAN location >vi etc/config/firewall
Add the lines:
accept:proto=tcp port=65534
accept:proto=tcp dport=22
accept:proto=tcp dport=8008
accept:proto=tcp dport=21

Legend

65534 - a must for torrent
22 - ssh (optional)
8008 - transmission.cgi (optional)
21 - ftp (optional)

to:

WAN Access

In order to make the torrent client pass your firewall you MUST open the torrent port to be "connectable" the other ports are options if you want to access your router from some other WAN location:

 vi etc/config/firewall

Add the lines:

 accept:proto=tcp port=65534
 accept:proto=tcp dport=22
 accept:proto=tcp dport=8008
 accept:proto=tcp dport=21

Legend:

 65534 - a must for torrent
 22    - ssh (optional)
 8008  - transmission.cgi (optional)
 21    - ftp (optional)
Added line 146:
Changed lines 149-150 from:

circular syslog

should be increased to 100k or more to see logs for more than one day.

to:

Circular syslog

Should be increased to 100k or more to see logs for more than one day.

February 15, 2007, at 09:02 AM by oleo --
Changed line 7 from:
  • batch multiprocessing (eg. 10 torrents simultaneously with nice priority)
to:
  • multithreading (eg. 10 torrents simultaneously with nice priority)
February 15, 2007, at 09:01 AM by oleo -- bypass
Changed line 14 from:
  • start/stop/push and other commands available in WWW interface
to:
  • start/stop/push/bypass and other commands available in WWW interface
Added lines 104-106:
  • Bypass: this will mark active torrent to be bypasswd by watchdow when it tries to enqueue
 new torrents from source. Use this for big and slow torrents that will be bypasswd by others.
February 15, 2007, at 06:21 AM by oleo --
Changed lines 102-103 from:

Update: this one updates the Active information with actual data. Since this update is an expensive operation for the router, it is usually cached and you need to press Update to refresh it. Otherwise, using List will only show the same old info.

to:
  • Update: this one updates the Active information with actual data. Since this update is an expensive operation for the router, it is usually cached and you need to press Update to refresh it. Otherwise, using List will only show the same old info.
February 15, 2007, at 06:20 AM by oleo -- Using torrents
Added lines 76-117:

Using Transmission

by wirespot

A lot of people, myself included, are probably having some trouble when they first run into Oleo web interface for torrent download (transmission.cgi). That's because it's a little different from the torrent programs they're used to. So I'm going to describe what's going on under the hood.

There are 3 pieces of software working on the torrents:

  1. transmissiond. This is the actual workhorse that's downloading and uploading a torrent. If you run "ps" in a console you will see several of them working (if you have torrents running). Every time a torrent starts, one of these comes along and takes charge of it.
  2. transmission_watchdog. This one runs periodically, usually every 30 minutes, and is in charge of moving torrents around the queues (from "queued" to "active" to "done").
  3. transmission.cgi this is the actual web interface and is the thing you use to see your torrents and control them.

How to use the torrents

You start by putting a torrent file under the source/ directory. You can do this in many ways: you can download it on a desktop computer and FTP or SCP it to the router; you can SSH to the router, go into that directory and wget it from a website; you can use the "Fetch" button in the web interface to give the URL and the cgi will wget it and put it under source/.

All torrents found under source/ are automatically seen as part of the "Queued" set of torrents. If there are no torrents in the "Active" set, the watchdog will fetch the first one in the Queued set the next time it runs and make it Active. Or, you can manually make as many torrents as you want Active by selecting them and using the Push button in the interface.

Everytime the watchdog runs it will also check for completed Active torrents (the ones seeding) and will move them to the Completed set, where they stop moving and wait for you to come get the files.

You can manually pause an Active torrent by selecting it and using the Push button. This will stop the torrent and put it in the Suspended set. It will not leave this set anymore unless you select it and use the Push button again. (That's right, Push does two different things; when the torrent is first Queued it moves it to Active, and then it moves it between Active and Suspended; there's no way to move it back to Queued anymore).

Active torrents (and their files) are found under the work/ dir. Queued torrents are under source/. Completed torrents are under target/. Suspended torrents are under work/, but are temporarily renamed to ".torrent.suspended".

What other buttons do:

  • List: this one gives the complete list of all the torrents in all the queues.

Update: this one updates the Active information with actual data. Since this update is an expensive operation for the router, it is usually cached and you need to press Update to refresh it. Otherwise, using List will only show the same old info.

  • Watchdog: this will force the watchdog to run now instead of waiting for the next normal time. This is useful if you see that a torrent has finished downloading and is seeding, but you don't want to wait for it to be moved to Completed the next time the watchdog would normally run. (Please note that you should let torrents seed so other people can benefit too. Instead of stopping that torrent, consider Push-ing a Queued one instead.)
  • Pause: this will stop all torrents temporarily. It does this by telling all transmissiond programs to die. It doesn't move torrents around the queues at all, there simply aren't downloads or uploads going. This will be marked clearly in big bold letters saying "torrent processing paused". Use Pause again to resume the Active torrents.
  • Info will show some information about the torrent (tracker, what files are in it and so on).
  • Log will try to create a graph showing the state of the downloads. Depends on whether you have gnuplot installed. (I personally prefer rrdtool, look around the forum for the rrdtool tutorial.)
  • Remove will mark a torrent for removal, and Purge will actually DELETE BOTH THE TORRENT AND THE FILES FOR IT. So be careful with it. Note that removal can be used for unfinished (suspended) torrents only. For removing torrents from target use other commands like rm -rf torrent-dir
  • Scrape will attempt to ask the tracker for the scrape info, and Best will attempt to suggest the best seed torrent from the completed ones.
  • Note will add your personal note to the torrent, in case you want to jot down something about it.
January 12, 2007, at 12:26 PM by oleo --
Changed lines 67-69 from:

X-wrt notes:

to:

Accessing/Uploading .torrent files:
You can do this either via fetch method thats available while viewing transmission.cgi (no cookie support!) and also with ftp and samba.
I prefer the ftp way since its locked with pass and very easy to start you only need to install vsftpd : \\

 >ipkg install vsftpd \\ 

Login details are set to your root login and pass by deafault.
For samba you need to try it our urself. Wiki : http://wiki.openwrt.org/SambaHowto?highlight=%28samba%29

X-wrt notes

Deleted lines 99-100:
January 12, 2007, at 12:25 PM by oleo --
Added lines 91-95:

circular syslog

should be increased to 100k or more to see logs for more than one day. http://img176.imageshack.us/img176/5545/xwrtsyslogmv7.png

January 12, 2007, at 12:24 PM by oleo --
Added lines 65-90:

X-wrt notes:

WAN Access

In order to make the torrent client pass your firewall you MUST open the torrent port to be "connectable" the other ports are options if you want to access your router from some other WAN location >vi etc/config/firewall
Add the lines:
accept:proto=tcp port=65534
accept:proto=tcp dport=22
accept:proto=tcp dport=8008
accept:proto=tcp dport=21

Legend

65534 - a must for torrent
22 - ssh (optional)
8008 - transmission.cgi (optional)
21 - ftp (optional)
WWW firewall setting should look like the following image: http://img79.imageshack.us/img79/1609/xwrtfirewalllz5.png

December 21, 2006, at 09:55 AM by oleo --
Changed line 53 from:

Install notest

to:

Install notes

December 21, 2006, at 09:54 AM by oleo --
Changed lines 60-62 from:
  1. m h dom mon dow user command
  • /30 * * * * admin nice transmission_watchdog
to:
 # m  h dom mon dow user command
 */30 *    * * *   admin nice transmission_watchdog 
December 21, 2006, at 09:54 AM by oleo -- Intro from readme
Added lines 1-64:

CGI interface to daemon is for managing and preview of the daemon state. There is also torrent_watchdog script for automatic torrent queue processing and mail notification.

Features

  • batch multiprocessing (eg. 10 torrents simultaneously with nice priority)
  • automatic seeding when torrent finishes (configurable)
  • configurable ports
  • WWW interface transmission.cgi can be public (no password) as
   there is no delete provided.
  • Accelerator keys (ALT-key) for CGI interface. See help for underlined keys.
  • Per torrent and cumulative status
  • start/stop/push and other commands available in WWW interface
  • lightweight - low memory footprint
  • tracker scrape info. Suggest best seed torrent from target dir.
  • watchdog for auto restart/queue processing with cron
  • syslog watchdog events
  • mail notify when torrent finishes
  • no state database required. Directory tree is database (slow, but fail-safe)
  • stable and portable. Developed on Asus WL-500g Deluxe with Oleg firmware

Workflow

For queue torrent file processing there should exist tree directories: source - User should copy .torrent files here work - Used for torrent processing target - Place where finished torrents are put

Typical file flow is source -> work -> target For every torrent file from source, directory with the same name is created. Then torrent file is moved into this directory and transmissiond is run in background and constantly supervised with transmission_watchdog. The only way for moving finished active torrent into target dir is with Watchdog and not with Push.

CGI interface to daemon after each command lists all torrents in database. This time consuming can be interrupted at any time by giving next command or pressing stop button in WWW browser. This can be done for all commands except URL, Note and Rename as the action on torrent is taken during listing. This means that listing should not be interrupted until torrent is listed. In general there is no problem of interrupting listing at any point. This will not invalidate database which is file system alone.

Fetch command is useful only for fetching torrent files without passkey as there is no possibility to pass cookies to server. Use with care. Proper fetch would be "download in browser and then upload to server". This can only be done by browser plugin.

Troubles with tracker communication can be seen in syslog file. There is no association of active thread and reported problem from tracker. User should resolve this alone.

Install notest

Before running transmission user should carefully inspect variables in transmission.conf and create SOURCE, WORK, and TARGET directories

transmission_watchdog cares for queue processing and should be run every 30 minutes with cron. /opt/etc/crontab entry should look like:

  1. m h dom mon dow user command
  • /30 * * * * admin nice transmission_watchdog

For graphing to work properly, gnuplot and syslog is required. As log can accumulate it is recommended that logrotate is used for flushing old logs.

view · edit · print · history · Last edited by SRS.
Based on work by SRS, Rai, BrianZhou, axm, fmt, Michael, arthur92710, Snake98, Brad, John, avgjoe, DarkGafarro, thomas, ralph, oleo, deleted, Federico, crebain, marceln, fcarolo, and Joop Verdoorn.
Originally by oleo.
Page last modified on November 13, 2014, at 05:31 AM