@@ -18,6 +18,7 @@ release='6'
1818codename=" ${os} _$release "
1919vestacp=" $VESTA /install/$VERSION /$release "
2020
21+ # Defining software pack for all distros
2122software=" nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded
2223 php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt
2324 php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-fpm php-pgsql
@@ -92,7 +93,7 @@ set_default_value() {
9293 fi
9394}
9495
95- # Define function to set default language value
96+ # Defining function to set default language value
9697set_default_lang () {
9798 if [ -z " $lang " ]; then
9899 eval lang=$1
@@ -112,9 +113,6 @@ set_default_lang() {
112113# Verifications #
113114# ----------------------------------------------------------#
114115
115- # Creating temporary file
116- tmpfile=$( mktemp -p /tmp)
117-
118116# Translating argument to --gnu-long-options
119117for arg; do
120118 delim=" "
@@ -226,7 +224,6 @@ if [ "$iptables" = 'no' ]; then
226224 fail2ban=' no'
227225fi
228226
229-
230227# Checking root permissions
231228if [ " x$( id -u) " != ' x0' ]; then
232229 check_result 1 " Script can be run executed only by root"
@@ -247,16 +244,18 @@ if [ ! -e '/usr/bin/wget' ]; then
247244fi
248245
249246# Checking repository availability
250- wget -q " http:// c.vestacp.com/GPG.txt" -O /dev/null
247+ wget -q " c.vestacp.com/GPG.txt" -O /dev/null
251248check_result $? " No access to Vesta repository"
252249
253250# Checking installed packages
251+ tmpfile=$( mktemp -p /tmp)
254252rpm -qa > $tmpfile
255253for pkg in exim mysql-server httpd nginx vesta; do
256254 if [ ! -z " $( grep $pkg $tmpfile ) " ]; then
257255 conflicts=" $pkg $conflicts "
258256 fi
259257done
258+ rm -f $tmpfile
260259if [ ! -z " $conflicts " ] && [ -z " $force " ]; then
261260 echo ' !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
262261 echo
277276# Brief Info #
278277# ----------------------------------------------------------#
279278
280- # Printing nice ascii as logo
279+ # Printing nice ASCII logo
281280clear
282281echo
283282echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
289288echo ' Vesta Control Panel'
290289echo -e " \n\n"
291290
292- echo ' Following software will be installed on your system:'
291+ echo ' The following software will be installed on your system:'
293292
294293# Web stack
295294if [ " $nginx " = ' yes' ]; then
@@ -310,16 +309,16 @@ if [ "$named" = 'yes' ]; then
310309 echo ' - Bind DNS Server'
311310fi
312311
313- # Mail Stack
312+ # Mail stack
314313if [ " $exim " = ' yes' ]; then
315- echo -n ' - Exim mail server '
314+ echo -n ' - Exim Mail Server '
316315 if [ " $clamd " = ' yes' ] || [ " $spamd " = ' yes' ] ; then
317316 echo -n ' + '
318317 if [ " $clamd " = ' yes' ]; then
319- echo -n ' Antivirus '
318+ echo -n ' ClamAV '
320319 fi
321320 if [ " $spamd " = ' yes' ]; then
322- echo -n ' Antispam '
321+ echo -n ' SpamAssassin '
323322 fi
324323 fi
325324 echo
@@ -328,9 +327,9 @@ if [ "$exim" = 'yes' ]; then
328327 fi
329328fi
330329
331- # DB stack
330+ # Database stack
332331if [ " $mysql " = ' yes' ]; then
333- if [ $release = 7 ]; then
332+ if [ $release -ge 7 ]; then
334333 echo ' - MariaDB Database Server'
335334 else
336335 echo ' - MySQL Database Server'
438437# Install repositories #
439438# ----------------------------------------------------------#
440439
441- # Updating system packages
440+ # Updating system
442441yum -y update
443442check_result $? ' yum update failed'
444443
@@ -463,7 +462,7 @@ echo "baseurl=http://$RHOST/$REPO/$release/\$basearch/" >> $vrepo
463462echo " enabled=1" >> $vrepo
464463echo " gpgcheck=1" >> $vrepo
465464echo " gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" >> $vrepo
466- wget http:// c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
465+ wget c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
467466
468467
469468# ----------------------------------------------------------#
@@ -476,53 +475,53 @@ cd $vst_backups
476475mkdir nginx httpd php php-fpm vsftpd proftpd named exim dovecot clamd \
477476 spamassassin mysql postgresql mongodb vesta
478477
479- # Backing up Nginx configuration
478+ # Backup Nginx configuration
480479service nginx stop > /dev/null 2>&1
481480cp -r /etc/nginx/* $vst_backups /nginx > /dev/null 2>&1
482481
483- # Backing up Apache configuration
482+ # Backup Apache configuration
484483service httpd stop > /dev/null 2>&1
485484cp -r /etc/httpd/* $vst_backups /httpd > /dev/null 2>&1
486485
487- # Backing up PHP configuration
486+ # Backup PHP-FPM configuration
488487service php-fpm stop > /dev/null 2>&1
489488cp /etc/php.ini $vst_backups /php > /dev/null 2>&1
490489cp -r /etc/php.d $vst_backups /php > /dev/null 2>&1
491490cp /etc/php-fpm.conf $vst_backups /php-fpm > /dev/null 2>&1
492491mv -f /etc/php-fpm.d/* $vst_backups /php-fpm/ > /dev/null 2>&1
493492
494- # Backing up Bind configuration
493+ # Backup Bind configuration
495494yum remove bind-chroot > /dev/null 2>&1
496495service named stop > /dev/null 2>&1
497496cp /etc/named.conf $vst_backups /named > /dev/null 2>&1
498497
499- # Backing up Vsftpd configuration
498+ # Backup Vsftpd configuration
500499service vsftpd stop > /dev/null 2>&1
501500cp /etc/vsftpd/vsftpd.conf $vst_backups /vsftpd > /dev/null 2>&1
502501
503- # Backing up ProFTPD configuration
502+ # Backup ProFTPD configuration
504503service proftpd stop > /dev/null 2>&1
505504cp /etc/proftpd.conf $vst_backups /proftpd > /dev/null 2>&1
506505
507- # Backing up Exim configuration
506+ # Backup Exim configuration
508507service exim stop > /dev/null 2>&1
509508cp -r /etc/exim/* $vst_backups /exim > /dev/null 2>&1
510509
511- # Backing up ClamAV configuration
510+ # Backup ClamAV configuration
512511service clamd stop > /dev/null 2>&1
513512cp /etc/clamd.conf $vst_backups /clamd > /dev/null 2>&1
514513cp -r /etc/clamd.d $vst_backups /clamd > /dev/null 2>&1
515514
516- # Backing up SpamAssassin configuration
515+ # Backup SpamAssassin configuration
517516service spamassassin stop > /dev/null 2>&1
518517cp -r /etc/mail/spamassassin/* $vst_backups /spamassassin > /dev/null 2>&1
519518
520- # Backing up Dovecot configuration
519+ # Backup Dovecot configuration
521520service dovecot stop > /dev/null 2>&1
522521cp /etc/dovecot.conf $vst_backups /dovecot > /dev/null 2>&1
523522cp -r /etc/dovecot/* $vst_backups /dovecot > /dev/null 2>&1
524523
525- # Backing up MySQL/MariaDB configuration and data
524+ # Backup MySQL/MariaDB configuration and data
526525service mysql stop > /dev/null 2>&1
527526service mysqld stop > /dev/null 2>&1
528527service mariadb stop > /dev/null 2>&1
@@ -531,18 +530,18 @@ cp /etc/my.cnf $vst_backups/mysql > /dev/null 2>&1
531530cp /etc/my.cnf.d $vst_backups /mysql > /dev/null 2>&1
532531mv /root/.my.cnf $vst_backups /mysql > /dev/null 2>&1
533532
534- # Backing up MySQL/MariaDB configuration and data
533+ # Backup MySQL/MariaDB configuration and data
535534service postgresql stop > /dev/null 2>&1
536535mv /var/lib/pgsql/data $vst_backups /postgresql/ > /dev/null 2>&1
537536
538- # Backing up Vesta configuration and data
537+ # Backup Vesta
539538service vesta stop > /dev/null 2>&1
540539mv $VESTA /data/* $vst_backups /vesta > /dev/null 2>&1
541540mv $VESTA /conf/* $vst_backups /vesta > /dev/null 2>&1
542541
543542
544543# ----------------------------------------------------------#
545- # Package Exludes #
544+ # Package Excludes #
546545# ----------------------------------------------------------#
547546
548547# Excluding packages
@@ -652,7 +651,7 @@ if [ -e '/etc/sysconfig/selinux' ]; then
652651 setenforce 0 2> /dev/null
653652fi
654653
655- # Disable iptables
654+ # Disabling iptables
656655service iptables stop
657656
658657# Configuring NTP synchronization
0 commit comments