11#! /bin/bash
22
3- # Vesta installer v.03
3+ # Vesta RHEL/CentOS installer v.03
44
55# ----------------------------------------------------------#
66# Variables&Functions #
@@ -11,11 +11,6 @@ CHOST='c.vestacp.com'
1111REPO=' cmmnt'
1212VERSION=' 0.9.8/rhel'
1313YUM_REPO=' /etc/yum.repos.d/vesta.repo'
14- arch=$( uname -i)
15- os=$( cut -f 1 -d ' ' /etc/redhat-release)
16- release=$( grep -o " [0-9]" /etc/redhat-release | head -n1)
17- codename=" ${os} _$release "
18- memory=$( grep ' MemTotal' /proc/meminfo | tr ' ' ' \n' | grep [0-9])
1914software=" nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid
2015 php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt
2116 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
2520 ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync
2621 rrdtool GeoIP freetype ntp openssh-clients vesta vesta-nginx vesta-php"
2722
28-
2923help () {
3024 echo " usage: $0 [OPTIONS]
3125 -d, --disable-remi Disable remi
@@ -92,10 +86,34 @@ if [ ! -e '/etc/redhat-release' ]; then
9286fi
9387
9488# Check supported OS
89+ arch=$( uname -i)
90+ os=$( cut -f 1 -d ' ' /etc/redhat-release)
91+ release=$( grep -o " [0-9]" /etc/redhat-release | head -n1)
92+ codename=" ${os} _$release "
9593if [ $os != ' CentOS' ] && [ $os != ' Red' ]; then
9694 echo ' Error: sorry, we currently support RHEL and CentOS only'
9795fi
9896
97+ # Check admin user account
98+ if [ ! -z " $( grep ^admin: /etc/passwd) " ] && [ " $force " != ' yes' ]; then
99+ echo " Error: user admin exists"
100+ echo
101+ echo ' Please remove admin user account before proceeding.'
102+ echo ' If you want to do it automatically run installer with -f option:'
103+ echo " Example: bash $0 --force"
104+ exit 1
105+ fi
106+
107+ # Check admin user account
108+ if [ ! -z " $( grep ^admin: /etc/group) " ] && [ " $force " != ' yes' ]; then
109+ echo " Error: user admin exists"
110+ echo
111+ echo ' Please remove admin user account before proceeding.'
112+ echo ' If you want to do it automatically run installer with -f option:'
113+ echo " Example: bash $0 --force"
114+ exit 1
115+ fi
116+
99117# Check wget
100118if [ ! -e ' /usr/bin/wget' ]; then
101119 yum -y install wget
@@ -137,6 +155,7 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
137155fi
138156
139157# Check server type
158+ memory=$( grep ' MemTotal' /proc/meminfo | tr ' ' ' \n' | grep [0-9])
140159if [ " $memory " -lt ' 350000' ] && [ -z " $force " ]; then
141160 echo " Error: not enough memory to install Vesta Control Panel."
142161 echo -e " \nMinimum RAM required: 350Mb"
0 commit comments