Advertisement
k3rn3lp4n1c

Untitled

Apr 4th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. distr=$(cat /etc/os-release | grep -m 1 '^ID')
  4.  
  5. echo "Update system before install VestaCP?(y/n)"
  6.  
  7. read updating
  8. if [ "$updating" = "y" ]; then
  9.     case $distr in
  10.         ID=ubuntu)
  11.             apt update
  12.             apt upgrade -y
  13.             ;;
  14.         ID=centos)
  15.             yum install -y epel-release
  16.             yum update -y
  17.             ;;
  18.         ID=debian)
  19.             apt update
  20.             apt upgrade -y
  21.             ;;
  22.     esac
  23. else
  24.     echo "Skip updating"
  25. fi
  26.  
  27. echo "Installing VestaCP, continue?(y/n)"
  28. read choice
  29. if [ "$choice" = "y" ]; then
  30.     echo "Select engine:"
  31.     echo "1 nginx+php-fpm"
  32.     echo "2 nginx+apache"
  33.     echo "3 apache"
  34.     echo "4 no"
  35.     echo "5 interactive mode"
  36.     read engine
  37.     cd /tmp
  38.     case $engine in
  39.         1)
  40.             curl -O http://vestacp.com/pub/vst-install.sh
  41.             bash vst-install.sh --nginx yes --phpfpm yes --apache no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav no --softaculous no --mysql yes --postgresql no --hostname $HOSTNAME  --interactive no  --email admin@$HOSTNAME
  42.  
  43.  
  44.  
  45.             ;;
  46.         2)
  47.             curl -O http://vestacp.com/pub/vst-install.sh
  48.             bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav no --softaculous no --mysql yes --postgresql no --hostname $HOSTNAME  --interactive no  --email admin@$HOSTNAME
  49.  
  50.  
  51.             ;;
  52.         3)
  53.             curl -O http://vestacp.com/pub/vst-install.sh
  54.             bash vst-install.sh --nginx no --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav no --softaculous no --mysql yes --postgresql no --hostname $HOSTNAME  --interactive no  --email admin@$HOSTNAME
  55.  
  56.  
  57.  
  58.             ;;
  59.         4)
  60.             curl -O http://vestacp.com/pub/vst-install.sh
  61.             bash vst-install.sh --nginx no --apache no --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin yes --clamav no --softaculous no --mysql yes --postgresql no --hostname $HOSTNAME --interactive no --email admin@$HOSTNAME
  62.  
  63.             ;;
  64.         5)
  65.             echo "Write the arguments for interactive install (for example -n yes -w yes ...)"
  66.             echo "Don't install ClamAV with Exim, because your mailserver will not work"
  67.             echo " -a, --apache            Install Apache        [yes|no]  default: yes"
  68.             echo " -n, --nginx             Install Nginx         [yes|no]  default: yes"
  69.             echo " -w, --phpfpm            Install PHP-FPM       [yes|no]  default: no"
  70.             echo " -v, --vsftpd            Install Vsftpd        [yes|no]  default: yes"
  71.             echo " -j, --proftpd           Install ProFTPD       [yes|no]  default: no"
  72.             echo " -k, --named             Install Bind          [yes|no]  default: yes"
  73.             echo " -m, --mysql             Install MySQL         [yes|no]  default: yes"
  74.             echo " -g, --postgresql        Install PostgreSQL    [yes|no]  default: no"
  75.             echo " -x, --exim              Install Exim          [yes|no]  default: yes"
  76.             echo " -z, --dovecot           Install Dovecot       [yes|no]  default: yes"
  77.             echo " -c, --clamav            Install ClamAV        [yes|no]  default: yes"
  78.             echo " -t, --spamassassin      Install SpamAssassin  [yes|no]  default: yes"
  79.             echo " -i, --iptables          Install Iptables      [yes|no]  default: yes"
  80.             echo " -b, --fail2ban          Install Fail2ban      [yes|no]  default: yes"
  81.             echo " -o, --softaculous       Install Softaculous   [yes|no]  default: yes"
  82.             echo " -q, --quota             Filesystem Quota      [yes|no]  default: no"
  83.             echo " -l, --lang              Default language                default: en"
  84.             echo " -y, --interactive       Interactive install   [yes|no]  default: yes"
  85.             echo " -s, --hostname          Set hostname"
  86.             echo " -e, --email             Set admin email"
  87.             echo " -p, --password          Set admin password"
  88.             echo " -f, --force             Force installation"
  89.             echo " -h, --help              Print this help"
  90.             read arguments
  91.             curl -O http://vestacp.com/pub/vst-install.sh
  92.             bash vst-install.sh "$arguments"
  93.             ;;
  94.     esac
  95. else
  96.     echo "Aborted"
  97. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement