Advertisement
S0lll0s

pReProx auto setup for instantserver.io servers

Jun 22nd, 2013
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.89 KB | None | 0 0
  1. #!/bin/bash
  2. valid=0
  3.  
  4. while [ "$valid" != 1 ]; do
  5.         read -p "Install apache / lamp? [y/N]" test
  6.         if [ "$test" = 'y' ] ; then
  7.         read -p "Wait and input any password for mysql [enter]"
  8.         yes | apt-get install lamp-server^
  9.                 valid=1
  10.         elif [ "$test" = 'n' ] || [ -z "$test" ]; then
  11.                 valid=1
  12.         fi
  13. done
  14. valid=0
  15.  
  16. while [ "$valid" != 1 ]; do
  17.         read -p "Install git? [y/N]" test
  18.         if [ "$test" = 'y' ]; then
  19.         yes | apt-get install git;
  20.                 valid=1
  21.         elif [ "$test" = 'n' ] || [ -z "$test" ]; then
  22.                 valid=1
  23.         fi
  24. done
  25. valid=0
  26.  
  27. while [ "$valid" != 1 ]; do
  28.         read -p "Install gcc? [y/N]" test
  29.         if [ "$test" = 'y' ]; then
  30.         yes | apt-get install gcc
  31.                 valid=1
  32.         elif [ "$test" = 'n' ] || [ -z "$test" ]; then
  33.                 valid=1
  34.         fi
  35. done
  36. valid=0
  37.  
  38. while [ "$valid" != 1 ]; do
  39.         read -p "Install php-sqlite? [Y/n]" test
  40.         if [ "$test" = 'y' ] || [ -z "$test" ]; then
  41.         yes | apt-get install php5-sqlite
  42.                 valid=1
  43.         elif [ "$test" = 'n' ]; then
  44.                 valid=1
  45.         fi
  46. done
  47. valid=0
  48.  
  49. read -p "Server root? [/var/www]: " root
  50. if [ -z "$root" ]; then
  51.     root="/var/www"
  52. fi
  53.  
  54. cd $root
  55. if [ -f "index.html" ]; then
  56.     rm index.html
  57. fi
  58.  
  59. while [ "$valid" != 1 ]; do
  60.         read -p "Checkout (update) code? [Y/n]" test
  61.         if [ $test = 'y' ] || [ -z $test ]; then
  62.         rm -rf *
  63.         git clone https://github.com/S0lll0s/pReProx.git .
  64.                 valid=1
  65.         elif [ $test = 'n' ]; then
  66.                 valid=1
  67.         fi
  68. done
  69. valid=0
  70.  
  71. chmod 777 *
  72. chmod 777 .
  73. echo "ServerRoot $root" > /etc/apache2/httpd.conf
  74. /etc/init.d/apache2 restart
  75. gcc -o newredir newredir.c
  76. chmod u+s newredir
  77. sudo chmod 6755 newredir
  78. read -p "Please change the settings in config.php [enter]"
  79. vi /var/www/config.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement