Advertisement
iarmin

rtorrent + rtgui installer

May 10th, 2011
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.41 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #: Filename    : rinstall.sh
  4. #: Title       : rtorrent and rtgui installer
  5. #: Author      : "Iarmin" <[email protected]>
  6. #: Version     : 0.1
  7. #: Description : Installs rtorrent with rtgui
  8. #
  9.  
  10. # setup
  11. WATCHDIR="/torrents/auto"
  12. DOWNLOADDIR="/torrents/download"
  13. SESSIONDIR="/torrents/session"
  14. INSTALLTEMP="/root"
  15. RTGUI_INSTALLTO="/var/www"
  16. APACHE2CONF="/etc/apache2/apache2.conf"
  17. WWWUSERGROUP="www-data:www-data"
  18. HTACCESS_USER="torrent"
  19. HTACCESS_PASS="12345"
  20.  
  21. #### remove this line! ####
  22. exit
  23. ####                   ####
  24.  
  25.  
  26.  
  27. # install depedencies
  28. aptitude update
  29. aptitude -y install automake autoconf libtool
  30. aptitude -y build-dep rtorrent libtorrent-dev libtorrent10 libtorrent11
  31. aptitude -y install php5 apache2 php5-xmlrpc libapache2-mod-php5 wget ncurses-dev make less build-essential
  32. aptitude -y install libxmlrpc-c-dev  libxmlrpc-c3-dev
  33. aptitude -y install libapache2-mod-scgi
  34. a2enmod scgi
  35. /etc/init.d/apache2 restart
  36.  
  37.  
  38. # configure setup
  39. INSTALLTEMP="$INSTALLTEMP/_rtguiinstaller_$$_"
  40. mkdir -p "$INSTALLTEMP"
  41. cd "$INSTALLTEMP"
  42.  
  43.  
  44. # install libtorrent
  45. wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
  46. tar -xf libtorrent-0.12.6.tar.gz
  47. cd libtorrent-0.12.6/
  48. ./configure
  49. make -j 5
  50. make
  51. make check
  52. make install
  53. make clean
  54. ldconfig
  55. cd ..
  56.  
  57.  
  58. # install xmlrpc-c
  59. wget http://downloads.sourceforge.net/project/xmlrpc-c/Xmlrpc-c%20Super%20Stable/1.16.35/xmlrpc-c-1.16.35.tgz
  60. tar -xf xmlrpc-c-1.16.35.tgz
  61. cd xmlrpc-c-1.16.35
  62. ./configure
  63. make -j 5
  64. make
  65. make install
  66. make clean
  67. ldconfig
  68. cd ..
  69.  
  70.  
  71. # install rtorrent
  72. wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz
  73. tar -xf rtorrent-0.8.6.tar.gz
  74. cd rtorrent-0.8.6/
  75. ./autogen.sh
  76. ./configure --with-xmlrpc-c
  77. make -j 5
  78. make
  79. make check
  80. make install
  81. make clean
  82. cd ..
  83.  
  84.  
  85. # install rtgui
  86. wget http://rtgui.googlecode.com/files/rtgui-0.2.81.tgz
  87. tar -xf rtgui-0.2.81.tgz
  88. mv rtgui "$RTGUI_INSTALLTO/"
  89. cd ..
  90. rm -rf "$INSTALLTEMP"
  91.  
  92.  
  93. # setup rtgui
  94. echo "<?php
  95. \$rpc_connect=\"http://localhost/RPC2\";
  96. \$watchdir=\"$WATCHDIR/\";
  97. \$downloaddir=\"$DOWNLOADDIR\";
  98. \$alertthresh=15;
  99. \$defaultrefresh=6000;
  100. \$displaytrackerurl=false;
  101. \$rtguiurl=\"\";
  102. \$defspeeds=array(5,10,15,20,30,40,50,60,70,80,90,100,125,150,200,250,300,400,500,600,700,800,900,1000,15    00,2000,5000,10000);
  103. \$load_start=true;
  104. \$debugtab=true;
  105. \$tracker_hilite_default=\"#900\";   // Default colour
  106. \$tracker_hilite[]=array(\"#990000\",\"ibiblio.org\",\"etree.org\");
  107. \$feeds[]=array(\"ibiblio.org\",\"http://torrent.ibiblio.org/feed.php?blockid=3\",0);
  108. " > "$RTGUI_INSTALLTO/rtgui/config.php"
  109. chown "$WWWUSERGROUP" "$RTGUI_INSTALLTO/rtgui/" -R
  110. echo
  111.  
  112.  
  113. # setup SCGI
  114. echo "SCGIMount /RPC2 127.0.0.1:5000" >> /etc/apache2/apache2.conf
  115. /etc/init.d/apache restart
  116.  
  117.  
  118. # setup rtorrent
  119. echo "
  120. min_peers= 40
  121. max_peers = 400
  122. max_uploads = 40
  123. upload_rate = 0
  124. download_rate = 0
  125. directory = $DOWNLOADDIR/
  126. session = $SESSIONDIR
  127. schedule = watch_directory,5,5,load_start=$WATCHDIR/*.torrent
  128. dht = off
  129. check_hash = no
  130. scgi_port = localhost:5000
  131. " > ~/.rtorrent
  132. mkdir -p "$DOWNLOADDIR"
  133. mkdir -p "$SESSIONDIR"
  134. mkdir -p "$WATCHDIR"
  135.  
  136.  
  137. # setup password
  138. echo "
  139. AuthName \"Protected Area\"
  140. AuthType Basic
  141. AuthUserFile "$RTGUI_INSTALLTO/rtgui/.htpasswd"
  142. require valid-user
  143. " > "$RTGUI_INSTALLTO/rtgui/.htaccess"
  144.  
  145. htpasswd -c -b "$RTGUI_INSTALLTO/rtgui/.htpasswd" "$HTACCESS_USER" "$HTACCESS_PASS"
  146.  
  147.  
  148. #  Done
  149. echo
  150. echo DONE.
  151. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement