![]() |
Optware.Transmission HistoryHide minor edits - Show changes to markup December 31, 2012, at 07:44 PM
by -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- 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 -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:
to:
http:// computerfixpro.com/WebClientFX?.zip -- minor Web UI fixes November 11, 2011, at 06:17 PM
by -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:
to:
November 11, 2011, at 06:13 PM
by -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:
to:
November 11, 2011, at 06:11 PM
by -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Changed lines 71-72 from:
to:
November 11, 2011, at 06:06 PM
by -- ipkg install Transmission 2.42+ & GUI & minor web ui fixes
Added lines 71-72:
November 02, 2011, at 06:53 PM
by -- 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 -- 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 -- 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 -- 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:
to:
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 -- Native compile/build Transmission
Added lines 50-55:
Native compile/build Transmissionhttp://www.nslu2-linux.org/wiki/HowTo/TransmissionCompileBuild April 30, 2011, at 12:14 AM
by -- Version 2.22-2 is fully functional
Added lines 52-61:
Version 2.22-2 is fully functionalDue 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 -- Still broken in version 2.0x
Changed lines 50-51 from:
Version 1.8xto:
Version 1.8x and aboveChanged 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 -- Version 1.8x broken, revert to 1.76
Added lines 50-65:
Version 1.8xVersions 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 -- 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 -- Version 1.73-1 NOTES
Added lines 50-86:
Version 1.73-1 NOTESAugust 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 -- version 1.70 notes
Added lines 50-70:
Version 1.70-2 NOTESJune, 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 -- Moved quick start guide section up
Changed lines 24-49 from:
to:
Quick start guideNew 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.3xNew 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:
Autostartavgjoe - 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. Autostartavgjoe - 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 -- formatting (linebreaks)
Changed line 52 from:
to:
#!/bin/sh\\ February 07, 2009, at 08:42 AM
by --
Added lines 52-114:
case $action in Version >= 1.3xNew 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. Autostartavgjoe - 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.3xNew 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:
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. Autostartavgjoe - 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 -- start-stop-cgi formatting
Deleted lines 51-113:
Version >= 1.3xNew 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. Autostartavgjoe - 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:
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.3xNew 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. Autostartavgjoe - 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 --
Added lines 50-84:
February 07, 2009, at 08:29 AM
by -- random ports without -p
Changed lines 47-49 from:
to:
January 30, 2009, at 07:05 PM
by -- 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.3xto:
Version >= 1.3xJanuary 22, 2009, at 11:23 PM
by -- formatting
Changed lines 27-48 from:
Version >= 1.3xto:
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.3xJanuary 03, 2009, at 04:47 PM
by -- version 1.42-1 settings notes
Changed lines 44-47 from:
to:
January 03, 2009, at 04:38 PM
by -- version 1.42-1 notes
Added lines 24-44:
Version 1.42-1 NOTES
December 04, 2008, at 09:04 PM
by -- question added
Changed lines 1348-1351 from:
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:
December 04, 2008, at 09:03 PM
by -- question added
Changed lines 1348-1351 from:
to:
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 -- question added
Changed lines 1347-1348 from:
to:
November 22, 2008, at 03:02 PM
by -- 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:
November 22, 2008, at 02:54 PM
by -- 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:
November 22, 2008, at 02:50 PM
by -- install notes
Added lines 44-47:
November 13, 2008, at 09:46 PM
by -- 1.40
Changed line 24 from:
Version 1.3xto:
Version >= 1.3xChanged 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:
October 24, 2008, at 05:37 PM
by --
Changed line 39 from:
to:
October 22, 2008, at 05:39 PM
by --
Changed line 75 from:
DD-WRT USERto:
DD-WRT USERChanged 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 --
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 itto:
Name a Torrent as you download it-- this is included with transmission 1.3x and upOctober 14, 2008, at 05:31 PM
by -- Questions on 1.3x
Added lines 75-78:
Questions & Answer on 1.3x
September 24, 2008, at 05:48 PM
by -- 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 -- 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 -- 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 Autostartavgjoe - 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 --
Changed line 1304 from:
to:
September 05, 2008, at 09:03 AM
by --
Changed line 1299 from:
to:
Changed lines 1303-1304 from:
@] to:
@]
September 03, 2008, at 07:37 PM
by -- attempt to answer question
Added lines 1300-1303:
"download-dir": "\/share\/hdd\/data\/public\/Torrents", September 03, 2008, at 09:00 AM
by --
Changed line 1299 from:
to:
September 03, 2008, at 08:59 AM
by -- added question
Added line 1299:
August 17, 2008, at 06:56 PM
by -- Transmission info
Changed lines 11-12 from:
to:
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 -- 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 --
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 -- Transmission 1.3 changes and start script suggestion
Changed lines 23-35 from:
Version 1.10http://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.3xavgjoe - 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:
August 07, 2008, at 09:15 PM
by --
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 --
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 --
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 --
Changed line 1262 from:
[@ to:
@] July 15, 2008, at 11:41 PM
by --
Changed line 1254 from:
to:
[@ Changed line 1262 from:
to:
[@ July 15, 2008, at 11:40 PM
by --
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 --
Deleted lines 1262-1263:
July 15, 2008, at 11:38 PM
by --
Deleted line 1257:
Deleted line 1258:
Deleted line 1259:
Deleted line 1260:
July 10, 2008, at 07:13 PM
by --
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 --
Deleted line 1255:
Deleted line 1256:
Deleted line 1257:
Deleted line 1258:
Deleted lines 1261-1264:
July 10, 2008, at 07:12 PM
by --
Deleted line 1263:
July 10, 2008, at 07:11 PM
by --
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 --
Added line 1263:
July 10, 2008, at 07:08 PM
by --
Added lines 1243-1275:
Name a Torrent as you download itI 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 -- 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:
May 21, 2008, at 06:33 PM
by -- Blocklist question
Changed lines 1247-1248 from:
to:
April 04, 2008, at 07:06 PM
by --
Added line 27:
Added line 29:
Added line 31:
April 04, 2008, at 07:06 PM
by --
Added line 25:
April 04, 2008, at 07:05 PM
by -- Added 1.10 details
Added lines 23-31:
Version 1.10http://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 --
Changed lines 1233-1234 from:
to:
March 28, 2008, at 11:47 PM
by -- 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:
March 28, 2008, at 11:46 PM
by --
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 --
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 --
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 QuestionsIs there a way to enable encryption and also disable unencrypted communication? January 31, 2008, at 07:50 AM
by -- 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 --
Changed line 8 from:
to:
September 17, 2007, at 04:08 PM
by --
Added lines 477-478:
[hash]!/bin/sh September 05, 2007, at 11:07 AM
by --
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 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 -- Fixed a typo
Changed line 461 from:
to:
Install notes for transmission on NSLU2 with Unslung 6.8August 18, 2007, at 10:40 AM
by -- REmove false wiki words
Changed line 456 from:
to:
June 25, 2007, at 10:20 PM
by --
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>
© 2005-2007 oleo
</address>
</body>
</html>
__EOF__
June 25, 2007, at 10:17 PM
by --
Changed lines 469-472 from:
to:
June 25, 2007, at 10:16 PM
by --
Changed lines 469-472 from:
to:
June 25, 2007, at 10:14 PM
by --
Added line 468:
Added line 472:
June 25, 2007, at 10:10 PM
by --
Changed lines 468-470 from:
to:
June 25, 2007, at 10:08 PM
by -- 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>
© 2005-2007 oleo
</address>
</body>
</html>
__EOF__
to:
June 25, 2007, at 10:06 PM
by -- 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 Crontab on OpenWrtIt 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 -- openwrt syslog
Added lines 156-163:
Syslog on OpenWrtIt 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 Tranmissionto:
Step 4 - Install TransmissionJune 01, 2007, at 10:16 AM
by -- 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:
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 rebootChanged 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 samba2Changed 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 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 In case your admin userid was changed to something else, pls edit Edit your [@ SHELL=/bin/sh Changed lines 400-401 from:
to:
@] Changed lines 404-405 from:
nano /opt/etc/init.d/S05syslogd to:
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 ( 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 (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 -- multitracker
Changed line 8 from:
to:
April 09, 2007, at 03:25 PM
by -- 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 -- libtransmission features
Added line 8:
Changed line 10 from:
to:
April 06, 2007, at 09:25 PM
by -- 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:
to:
Deleted lines 873-874:
# Removed ? Not pushed
fi
Added lines 875-876:
fi April 06, 2007, at 09:22 PM
by -- Configuration for NSLU2
Changed lines 412-421 from:
The file-contents of transmission.cgi can be changed to:
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:
to:
Deleted lines 434-435:
Changed line 447 from:
to:
Changed line 494 from:
to:
Changed line 527 from:
to:
Changed line 540 from:
to:
Changed line 547 from:
to:
Changed line 555 from:
to:
Changed line 573 from:
to:
Changed line 609 from:
to:
Changed line 646 from:
to:
Changed lines 666-667 from:
to:
Changed line 692 from:
to:
Changed line 702 from:
to:
Deleted lines 720-721:
Changed line 838 from:
to:
Changed line 855 from:
to:
Changed line 890 from:
to:
Changed lines 912-913 from:
to:
Changed lines 1010-1011 from:
to:
Changed lines 1062-1065 from:
to:
Changed lines 1111-1114 from:
to:
Changed lines 1116-1117 from:
to:
Changed line 1122 from:
to:
Changed line 1128 from:
to:
Changed lines 1131-1133 from:
to:
Changed lines 1134-1137 from:
to:
Changed line 1137 from:
to:
Changed lines 1140-1142 from:
to:
Changed lines 1145-1146 from:
HTTP_IMG_LOCATION=../transfer.png
to:
Changed line 1148 from:
to:
Changed lines 1150-1151 from:
to:
April 06, 2007, at 09:16 PM
by -- Added configuration for NSLU2
Changed lines 407-1192 from:
to:
Install notes for transmission on NLSU2? with Unslung 6.8The 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.cgiThis 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:
. /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 () { # 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
}
_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
# 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>"
}
_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 "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> © 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.confThis 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 WORK=/share/hdd/data/Torrents/Work TARGET=/share/hdd/data/Torrents/Target
MAILOPT="-smail.somedomain.com -f" USER=root GROUP=root DATE_FORMAT="h M"
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
UPLOAD_SPEED=41 DOWNLOAD_SPEED=180
SYSLOG=/var/log/messages
AUTOSEED="YES"
MAX_ACTIVE_TORRENTS=10
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
TIMEZONE_OFFSET=+3600
GREEN="\033[32;1m"
NORMAL="\033[0m" WARN="\033[33;1m" BAD="\033[31;1m" BOLD="\033[1m" GOOD="\033[32;1m" Remove S80busybox_httpdThis file is located in /opt/etc/init.d. Adjust crontabIn /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 -- 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:
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:
- 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 -- 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 -- 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:
Changed lines 338-339 from:
Step4 - Install Tranmission to:
Step 4 - Install TranmissionChanged 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=/
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:
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:
February 23, 2007, at 08:14 AM
by -- formatting February 23, 2007, at 08:14 AM
by -- formatting February 23, 2007, at 08:13 AM
by -- 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
Changed line 174 from:
9) Reboot the router (using web interface) to:
Changed lines 176-178 from:
Step 2 - Prepare the disk to:
Step 2 - Prepare the diskChanged 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:
then
insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
fi
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
i=`expr $i + 1`
done
/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:
iptables -P INPUT DROP
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP
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:
if [ ! -d /dev/discs ] then insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s fi
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
swapon /dev/discs/disc0/part1
echo "export TERMINFO=/opt/share/terminfo">>/etc/profile echo "alias mc=\"mc -c\"">>/etc/profile
/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:
iptables -P INPUT DROP
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP
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:
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=/
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:
to:
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:
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=/
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:
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 -- oleg fw -- needs formating
Added lines 154-393:
Oleg firmware and TransmissionMy 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:
if [ ! -d /dev/discs ] then insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s fi
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
swapon /dev/discs/disc0/part1
echo "export TERMINFO=/opt/share/terminfo">>/etc/profile echo "alias mc=\"mc -c\"">>/etc/profile
/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:
iptables -P INPUT DROP
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP
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:
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=/
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:
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 -- formatting and cleanup
Changed lines 10-11 from:
there is no delete provided. to:
Changed lines 66-74 from:
Accessing/Uploading .torrent files:
|