Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # set variables for easy access
- $username = "rtorrent"
- $password = "rtor"
- $s3bucketname = "s3-conf-bootscripts"
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Adding webmin repository +"
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- sleep 2
- echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list
- cd /root
- wget http://www.webmin.com/jcameron-key.asc
- apt-key add jcameron-key.asc
- # General updates and cleanup
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= General updates and cleanup +"
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- sleep 1
- apt update -y
- apt dist-upgrade -y
- apt autoremove -y
- # install necessities and dependencies
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Installing this shit +"
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- sleep 1
- apt install apache2 vim-nox screen vnstat webmin munin-node build-essential subversion autoconf g++ gcc ntp curl comerr-dev pkg-config cfv libtool libssl-dev libncurses5-dev ncurses-term libsigc++-2.0-dev libcppunit-dev libcurl3 libcurl4-openssl-dev git apt-transport-https apache2-utils libapache2-mod-php -y
- vnstat -u
- # XML-RPC install
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- echo "= installing XML-RPC ="
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 2
- svn co -q https://svn.code.sf.net/p/xmlrpc-c/code/stable /tmp/xmlrpc-c
- cd /tmp/xmlrpc-c
- ./configure --disable-libwww-client --disable-wininet-client --disable-abyss-server --disable-cgi-server
- make -j4
- sudo make install
- # Libtorrent install
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- echo "= installing libtorrent ="
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 2
- cd /tmp
- curl http://rtorrent.net/downloads/libtorrent-0.13.6.tar.gz | tar xz
- cd libtorrent-0.13.6
- ./autogen.sh
- ./configure
- make -j4
- sudo make install
- # Setting up user/rtorrent environment
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Downloading and installing rtorrent ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 2
- cd /tmp
- curl http://rtorrent.net/downloads/rtorrent-0.9.6.tar.gz | tar xzcd rtorrent-0.9.6
- ./autogen.sh
- ./configure --with-xmlrpc-c
- make -j4
- sudo make install
- sudo ldconfig
- # Creating user
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Creating rtorrent user ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- useradd -m -p $(perl -e 'print crypt($ARGV[0], "password")' $password) $username
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Setting up folders ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 1
- cd /home/rtorrent
- mkdir -p .session
- mkdir -p watch/{tv,films,games,apps,music}
- mkdir -p downloads/{_completed,tv,films,games,apps,music}
- mkdir -p downloads/_completed/{tv,films,games,apps,music}
- chown -R rtorrent:rtorrent /home/rtorrent/
- # add script to set rtorrent to start on boot - maybe do irssi as well?
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Making rtorrent start on boot ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 1
- aws s3 cp s3://$s3bucketname/rtorrent-conf/.rtorrent.rc /home/rtorrent/.rtorrent.rc
- aws s3 cp s3://$s3bucketname/linux-conf/rtorrent_init.sh /etc/init.d/rtorrent
- chmod +x /etc/init.d/rtorrent
- update-rc.d rtorrent defaults 99
- # installing rutorrent
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Setting up apache ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- sleep 1
- a2enmod auth_digest ssl reqtimeout
- #TODO back up apache2 config file, adapt and upload somewhere to be echo'ed into /etc/apache2/apache2.conf
- echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="
- echo "= Setting up rtorrent environment +"
- echo "+ Downloading config files for apache2 ="
- echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
- aws s3 cp s3://$s3bucketname/apache-conf/apache2.conf /etc/apache2/apache2.conf
- aws s3 cp s3://$s3bucketname/apache-conf/.htpasswd /etc/apache2/.htpasswd
- aws s3 cp s3://$s3bucketname/apache-conf/sites-available/rtorrent.conf /etc/apache2/sites-available/rtorrent.conf
- a2dissite 000-default
- a2ensite rtorrent
- service apache2 restart
- cd /var/www/html
- git clone https://github.com/Novik/ruTorrent.git rutorrent
- rm -r rutorrent/plugins
- svn checkout https://github.com/Novik/ruTorrent/trunk/plugins rutorrent/plugins
- # TODO set the config files straight
- aws s3 cp s3://$s3bucketname/rtorrent-config/rutorrent/config.php /var/www/html/rutorrent/conf/config.php
- # TODO figure out where autotools saves its configuration and back this up.
- chown -R www-data:www-data /var/www/
- chmod -R 0755 /var/www/
- # TODO figure out where autotools saves its configuration and back this up.
- reboot now
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement