SHARE
TWEET

setup

alon2k2 Aug 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. # Regular Colors
  4. Red='\033[0;31m'          # Red
  5. Green='\033[0;32m'        # Green
  6. Yellow='\033[0;33m'       # Yellow
  7. Purple='\033[0;35m'       # Purple
  8. Cyan='\033[0;36m'         # Cyan
  9. Color_Off='\033[0m'       # Text Reset
  10.  
  11. # Update packages and upgrade system
  12. echo "$Yellow Updating System... $Color_Off"
  13. sudo apt-get update -y && sudo apt-get upgrade -y
  14.  
  15. ## Root password
  16. while true; do
  17.     echo -n "$Cyan Do you want to set a password for root user? [Y/n] $Color_Off"
  18.     read yn
  19.     case $yn in
  20.         [Yy]* )
  21.             passwd root
  22.         break;;
  23.         [Nn]* ) break;;
  24.         * ) break;;
  25.     esac
  26. done
  27.  
  28. # Define hostname
  29. echo -n "$Cyan Enter your hostname? $Color_Off"
  30. read hostname
  31. if [ -n "$hostname" ]; then
  32.     hostname $hostname
  33. fi
  34.  
  35. # Install Apache2
  36. while true; do
  37.     echo -n "$Cyan Do you wish to install apache2? [Y/n] $Color_Off"
  38.     read yn
  39.     case $yn in
  40.         [Yy]* )
  41.             echo "$Yellow Installing apache2... $Color_Off"
  42.             sudo apt install -y apache2
  43.             echo "ServerTokens Prod" >> /etc/apache2/apache2.conf
  44.             echo "ServerSignature Off" >> /etc/apache2/apache2.conf
  45.         break;;
  46.         [Nn]* ) break;;
  47.         * ) break;;
  48.     esac
  49. done
  50.  
  51. # Install vsftpd
  52. while true; do
  53.     echo -n "$Cyan Do you wish to install vsftpd? [Y/n] $Color_Off"
  54.     read yn
  55.     case $yn in
  56.         [Yy]* )
  57.             echo "$Yellow Installing vsftpd... $Color_Off"
  58.             sudo apt-get install -y vsftpd
  59.            
  60.         break;;
  61.         [Nn]* ) break;;
  62.         * ) break;;
  63.     esac
  64. done
  65.  
  66. #sed -i 's/^\(last_name\s*=\s*\).*$/\1AAA/' test
  67.  
  68. echo "###################################"
  69. echo "$Yellow Installation completed successfully! $Color_Off";
  70. echo "###################################"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top