mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 21:04:06 -07:00
improved preinstall validation
This commit is contained in:
parent
9e8dec0e31
commit
12a7181dc8
2 changed files with 59 additions and 16 deletions
|
@ -10,15 +10,6 @@ export DEBIAN_FRONTEND=noninteractive
|
||||||
RHOST='apt.vestacp.com'
|
RHOST='apt.vestacp.com'
|
||||||
CHOST='c.vestacp.com'
|
CHOST='c.vestacp.com'
|
||||||
VERSION='0.9.8/ubuntu'
|
VERSION='0.9.8/ubuntu'
|
||||||
if [ "$(arch)" != 'x86_64' ]; then
|
|
||||||
arch='i386'
|
|
||||||
else
|
|
||||||
arch="amd64"
|
|
||||||
fi
|
|
||||||
os=$(head -n 1 /etc/issue | cut -f 1 -d ' ')
|
|
||||||
release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' )
|
|
||||||
codename=$(lsb_release -cs)
|
|
||||||
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
|
|
||||||
software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom
|
software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom
|
||||||
libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn
|
libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn
|
||||||
mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql
|
mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql
|
||||||
|
@ -90,11 +81,43 @@ if [ -e '/etc/redhat-release' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check supported OS
|
# Check supported OS
|
||||||
|
if [ "$(arch)" != 'x86_64' ]; then
|
||||||
|
arch='i386'
|
||||||
|
else
|
||||||
|
arch="amd64"
|
||||||
|
fi
|
||||||
|
os=$(head -n 1 /etc/issue | cut -f 1 -d ' ')
|
||||||
|
release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' )
|
||||||
|
if [ -e "/usr/bin/lsb_release" ]; then
|
||||||
|
codename=$(lsb_release -cs)
|
||||||
|
else
|
||||||
|
codename='unknown'
|
||||||
|
fi
|
||||||
if [ $codename != 'precise' ] && [ $codename != 'raring' ]; then
|
if [ $codename != 'precise' ] && [ $codename != 'raring' ]; then
|
||||||
echo 'Error: only Ubuntu LTS 12.04 and Ubuntu 13.04 is supported'
|
echo 'Error: only Ubuntu LTS 12.04 and Ubuntu 13.04 is supported'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check admin user account
|
||||||
|
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then
|
||||||
|
echo "Error: user admin exists"
|
||||||
|
echo
|
||||||
|
echo 'Please remove admin user account before proceeding.'
|
||||||
|
echo 'If you want to do it automatically run installer with -f option:'
|
||||||
|
echo "Example: bash $0 --force"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check admin user account
|
||||||
|
if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then
|
||||||
|
echo "Error: user admin exists"
|
||||||
|
echo
|
||||||
|
echo 'Please remove admin user account before proceeding.'
|
||||||
|
echo 'If you want to do it automatically run installer with -f option:'
|
||||||
|
echo "Example: bash $0 --force"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Check wget
|
# Check wget
|
||||||
if [ ! -e '/usr/bin/wget' ]; then
|
if [ ! -e '/usr/bin/wget' ]; then
|
||||||
apt-get -y install wget
|
apt-get -y install wget
|
||||||
|
@ -136,6 +159,7 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check server type
|
# Check server type
|
||||||
|
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
|
||||||
if [ "$memory" -lt '350000' ] && [ -z "$force" ]; then
|
if [ "$memory" -lt '350000' ] && [ -z "$force" ]; then
|
||||||
echo "Error: not enough memory to install Vesta Control Panel."
|
echo "Error: not enough memory to install Vesta Control Panel."
|
||||||
echo -e "\nMinimum RAM required: 350Mb"
|
echo -e "\nMinimum RAM required: 350Mb"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Vesta installer v.03
|
# Vesta RHEL/CentOS installer v.03
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variables&Functions #
|
# Variables&Functions #
|
||||||
|
@ -11,11 +11,6 @@ CHOST='c.vestacp.com'
|
||||||
REPO='cmmnt'
|
REPO='cmmnt'
|
||||||
VERSION='0.9.8/rhel'
|
VERSION='0.9.8/rhel'
|
||||||
YUM_REPO='/etc/yum.repos.d/vesta.repo'
|
YUM_REPO='/etc/yum.repos.d/vesta.repo'
|
||||||
arch=$(uname -i)
|
|
||||||
os=$(cut -f 1 -d ' ' /etc/redhat-release)
|
|
||||||
release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
|
|
||||||
codename="${os}_$release"
|
|
||||||
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
|
|
||||||
software="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid
|
software="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid
|
||||||
php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt
|
php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt
|
||||||
php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-pecl-apc
|
php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-pecl-apc
|
||||||
|
@ -25,7 +20,6 @@ software="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid
|
||||||
ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync
|
ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync
|
||||||
rrdtool GeoIP freetype ntp openssh-clients vesta vesta-nginx vesta-php"
|
rrdtool GeoIP freetype ntp openssh-clients vesta vesta-nginx vesta-php"
|
||||||
|
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo "usage: $0 [OPTIONS]
|
echo "usage: $0 [OPTIONS]
|
||||||
-d, --disable-remi Disable remi
|
-d, --disable-remi Disable remi
|
||||||
|
@ -92,10 +86,34 @@ if [ ! -e '/etc/redhat-release' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check supported OS
|
# Check supported OS
|
||||||
|
arch=$(uname -i)
|
||||||
|
os=$(cut -f 1 -d ' ' /etc/redhat-release)
|
||||||
|
release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
|
||||||
|
codename="${os}_$release"
|
||||||
if [ $os != 'CentOS' ] && [ $os != 'Red' ]; then
|
if [ $os != 'CentOS' ] && [ $os != 'Red' ]; then
|
||||||
echo 'Error: sorry, we currently support RHEL and CentOS only'
|
echo 'Error: sorry, we currently support RHEL and CentOS only'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check admin user account
|
||||||
|
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then
|
||||||
|
echo "Error: user admin exists"
|
||||||
|
echo
|
||||||
|
echo 'Please remove admin user account before proceeding.'
|
||||||
|
echo 'If you want to do it automatically run installer with -f option:'
|
||||||
|
echo "Example: bash $0 --force"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check admin user account
|
||||||
|
if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then
|
||||||
|
echo "Error: user admin exists"
|
||||||
|
echo
|
||||||
|
echo 'Please remove admin user account before proceeding.'
|
||||||
|
echo 'If you want to do it automatically run installer with -f option:'
|
||||||
|
echo "Example: bash $0 --force"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Check wget
|
# Check wget
|
||||||
if [ ! -e '/usr/bin/wget' ]; then
|
if [ ! -e '/usr/bin/wget' ]; then
|
||||||
yum -y install wget
|
yum -y install wget
|
||||||
|
@ -137,6 +155,7 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check server type
|
# Check server type
|
||||||
|
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
|
||||||
if [ "$memory" -lt '350000' ] && [ -z "$force" ]; then
|
if [ "$memory" -lt '350000' ] && [ -z "$force" ]; then
|
||||||
echo "Error: not enough memory to install Vesta Control Panel."
|
echo "Error: not enough memory to install Vesta Control Panel."
|
||||||
echo -e "\nMinimum RAM required: 350Mb"
|
echo -e "\nMinimum RAM required: 350Mb"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue