Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- #: Filename : rinstall.sh
- #: Title : rtorrent and rtgui installer
- #: Author : "Iarmin" <[email protected]>
- #: Version : 0.1
- #: Description : Installs rtorrent with rtgui
- #
- # setup
- WATCHDIR="/torrents/auto"
- DOWNLOADDIR="/torrents/download"
- SESSIONDIR="/torrents/session"
- INSTALLTEMP="/root"
- RTGUI_INSTALLTO="/var/www"
- APACHE2CONF="/etc/apache2/apache2.conf"
- WWWUSERGROUP="www-data:www-data"
- HTACCESS_USER="torrent"
- HTACCESS_PASS="12345"
- #### remove this line! ####
- exit
- #### ####
- # install depedencies
- aptitude update
- aptitude -y install automake autoconf libtool
- aptitude -y build-dep rtorrent libtorrent-dev libtorrent10 libtorrent11
- aptitude -y install php5 apache2 php5-xmlrpc libapache2-mod-php5 wget ncurses-dev make less build-essential
- aptitude -y install libxmlrpc-c-dev libxmlrpc-c3-dev
- aptitude -y install libapache2-mod-scgi
- a2enmod scgi
- /etc/init.d/apache2 restart
- # configure setup
- INSTALLTEMP="$INSTALLTEMP/_rtguiinstaller_$$_"
- mkdir -p "$INSTALLTEMP"
- cd "$INSTALLTEMP"
- # install libtorrent
- wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
- tar -xf libtorrent-0.12.6.tar.gz
- cd libtorrent-0.12.6/
- ./configure
- make -j 5
- make
- make check
- make install
- make clean
- ldconfig
- cd ..
- # install xmlrpc-c
- wget http://downloads.sourceforge.net/project/xmlrpc-c/Xmlrpc-c%20Super%20Stable/1.16.35/xmlrpc-c-1.16.35.tgz
- tar -xf xmlrpc-c-1.16.35.tgz
- cd xmlrpc-c-1.16.35
- ./configure
- make -j 5
- make
- make install
- make clean
- ldconfig
- cd ..
- # install rtorrent
- wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz
- tar -xf rtorrent-0.8.6.tar.gz
- cd rtorrent-0.8.6/
- ./autogen.sh
- ./configure --with-xmlrpc-c
- make -j 5
- make
- make check
- make install
- make clean
- cd ..
- # install rtgui
- wget http://rtgui.googlecode.com/files/rtgui-0.2.81.tgz
- tar -xf rtgui-0.2.81.tgz
- mv rtgui "$RTGUI_INSTALLTO/"
- cd ..
- rm -rf "$INSTALLTEMP"
- # setup rtgui
- echo "<?php
- \$rpc_connect=\"http://localhost/RPC2\";
- \$watchdir=\"$WATCHDIR/\";
- \$downloaddir=\"$DOWNLOADDIR\";
- \$alertthresh=15;
- \$defaultrefresh=6000;
- \$displaytrackerurl=false;
- \$rtguiurl=\"\";
- \$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);
- \$load_start=true;
- \$debugtab=true;
- \$tracker_hilite_default=\"#900\"; // Default colour
- \$tracker_hilite[]=array(\"#990000\",\"ibiblio.org\",\"etree.org\");
- \$feeds[]=array(\"ibiblio.org\",\"http://torrent.ibiblio.org/feed.php?blockid=3\",0);
- " > "$RTGUI_INSTALLTO/rtgui/config.php"
- chown "$WWWUSERGROUP" "$RTGUI_INSTALLTO/rtgui/" -R
- echo
- # setup SCGI
- echo "SCGIMount /RPC2 127.0.0.1:5000" >> /etc/apache2/apache2.conf
- /etc/init.d/apache restart
- # setup rtorrent
- echo "
- min_peers= 40
- max_peers = 400
- max_uploads = 40
- upload_rate = 0
- download_rate = 0
- directory = $DOWNLOADDIR/
- session = $SESSIONDIR
- schedule = watch_directory,5,5,load_start=$WATCHDIR/*.torrent
- dht = off
- check_hash = no
- scgi_port = localhost:5000
- " > ~/.rtorrent
- mkdir -p "$DOWNLOADDIR"
- mkdir -p "$SESSIONDIR"
- mkdir -p "$WATCHDIR"
- # setup password
- echo "
- AuthName \"Protected Area\"
- AuthType Basic
- AuthUserFile "$RTGUI_INSTALLTO/rtgui/.htpasswd"
- require valid-user
- " > "$RTGUI_INSTALLTO/rtgui/.htaccess"
- htpasswd -c -b "$RTGUI_INSTALLTO/rtgui/.htpasswd" "$HTACCESS_USER" "$HTACCESS_PASS"
- # Done
- echo
- echo DONE.
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement