Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- grep -q -F "deb ftp://ftp.us.debian.org/debian/ wheezy non-free" /etc/apt/sources.list || echo "deb ftp://ftp.us.debian.org/debian/ wheezy non-free" >> /etc/apt/sources.list
- grep -q -F "deb http://security.debian.org/ wheezy/updates non-free" /etc/apt/sources.list || echo "deb http://security.debian.org/ wheezy/updates non-free" >> /etc/apt/sources.list
- apt-get update
- apt-get install -y curl wget git
- echo "======== rTorrent ========"
- echo "Installing rTorrent"
- apt-get install -y rtorrent
- echo "Configuring rTorrent"
- echo -n "Enter torrent user name [torrent] : "
- read USER
- if [ "$USER" == "" ]
- then
- USER="torrent"
- fi
- echo -n "Enter $USER password : "
- read -s PASSWD
- adduser $USER --disabled-password
- echo $USER:$PASSWD | chpasswd
- echo "Creating directories"
- mkdir /home/$USER/rtorrent
- mkdir -p /home/$USER/rtorrent/{.session,download,log,watch/load,watch/start}
- chown -R $USER /home/$USER/
- echo "Getting config template from rtorrent GitHub"
- curl -s https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md | grep -A9999 '^######' | grep -B9999 '^### END' >/home/$USER/.rtorrent.rc
- echo "Tweaking configs ..."
- sed -i -- "s/USERNAME/$USER/" /home/$USER/.rtorrent.rc
- echo "scgi_port = localhost:5002" >>/home/$USER/.rtorrent.rc
- echo "========= Apache ========="
- echo "Installing Apache 2"
- apt-get install -y apache2
- echo "Installing PHP"
- apt-get install -y php5-common libapache2-mod-php5 php5-cli
- echo "Configuring Apache 2"
- a2enmod proxy_scgi
- #a2enmod auth_digest
- echo "ProxyPass /RPC2 scgi://127.0.0.1:5002" >> /etc/apache2/apache2.conf
- echo "Restarting Apache 2"
- service apache2 restart
- echo "======== ruTorrent ======="
- echo "Installing depandencis"
- apt-get install curl gzip zip unzip unrar rar
- echo "Creating path"
- mkdir /var/www/rutorrent
- ln -s /var/www/rutorrent /var/www/html/rutorrent
- mkdir /var/www/rutorrent/$USER
- echo "Downloading ruTorrent"
- git clone https://github.com/Novik/ruTorrent.git /var/www/rutorrent/$USER/
- echo "Tweaking configs ..."
- sed -i -- "s/$scgi_port = 5000/$scgi_port = 5002/" /var/www/rutorrent/$USER/conf/config.php
- chown -R www-data:www-data /var/www
- echo "======== Screen ========="
- echo "Just installing screen in case it is not yet installed ..."
- apt-get install -y screen
- echo "DONE !!!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement