Advertisement
Arceus02

Seedbox Install Script

Feb 1st, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.28 KB | None | 0 0
  1. #!/bin/bash
  2. 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
  3. 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
  4. apt-get update
  5. apt-get install -y curl wget git
  6.  
  7. echo "======== rTorrent ========"
  8. echo "Installing rTorrent"
  9. apt-get install -y rtorrent
  10. echo "Configuring rTorrent"
  11. echo -n "Enter torrent user name [torrent] : "
  12. read USER
  13. if [ "$USER" == "" ]
  14. then
  15.         USER="torrent"
  16. fi
  17. echo -n "Enter $USER password : "
  18. read -s PASSWD
  19. adduser $USER --disabled-password
  20. echo $USER:$PASSWD | chpasswd
  21. echo "Creating directories"
  22. mkdir /home/$USER/rtorrent
  23. mkdir -p /home/$USER/rtorrent/{.session,download,log,watch/load,watch/start}
  24. chown -R $USER /home/$USER/
  25. echo "Getting config template from rtorrent GitHub"
  26. curl -s https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md | grep -A9999 '^######' | grep -B9999 '^### END' >/home/$USER/.rtorrent.rc
  27. echo "Tweaking configs ..."
  28. sed -i -- "s/USERNAME/$USER/" /home/$USER/.rtorrent.rc
  29. echo "scgi_port = localhost:5002" >>/home/$USER/.rtorrent.rc
  30.  
  31. echo "========= Apache ========="
  32. echo "Installing Apache 2"
  33. apt-get install -y apache2
  34. echo "Installing PHP"
  35. apt-get install -y php5-common libapache2-mod-php5 php5-cli
  36. echo "Configuring Apache 2"
  37. a2enmod proxy_scgi
  38. #a2enmod auth_digest
  39. echo "ProxyPass /RPC2 scgi://127.0.0.1:5002" >> /etc/apache2/apache2.conf
  40. echo "Restarting Apache 2"
  41. service apache2 restart
  42.  
  43. echo "======== ruTorrent ======="
  44. echo "Installing depandencis"
  45. apt-get install curl gzip zip unzip unrar rar
  46. echo "Creating path"
  47. mkdir /var/www/rutorrent
  48. ln -s /var/www/rutorrent /var/www/html/rutorrent
  49. mkdir /var/www/rutorrent/$USER
  50. echo "Downloading ruTorrent"
  51. git clone https://github.com/Novik/ruTorrent.git /var/www/rutorrent/$USER/
  52. echo "Tweaking configs ..."
  53. sed -i -- "s/$scgi_port = 5000/$scgi_port = 5002/" /var/www/rutorrent/$USER/conf/config.php
  54. chown -R www-data:www-data /var/www
  55.  
  56. echo "======== Screen ========="
  57. echo "Just installing screen in case it is not yet installed ..."
  58. apt-get install -y screen
  59.  
  60. echo "DONE !!!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement