mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 13:01:52 -07:00
added return code verifications
This commit is contained in:
parent
7113dd6625
commit
580e308f9e
1 changed files with 48 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Vesta installer v.03
|
# Vesta installer v.03
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -412,6 +413,9 @@ fi
|
||||||
# Configure system #
|
# Configure system #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Set writable permission on tmp directory
|
||||||
|
chmod 777 /tmp
|
||||||
|
|
||||||
# Disabling SELinux
|
# Disabling SELinux
|
||||||
if [ -e '/etc/sysconfig/selinux' ]; then
|
if [ -e '/etc/sysconfig/selinux' ]; then
|
||||||
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
|
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
|
||||||
|
@ -472,6 +476,10 @@ chmod 640 /var/log/httpd/suexec.log
|
||||||
chmod 751 /var/log/httpd/domains
|
chmod 751 /var/log/httpd/domains
|
||||||
chkconfig httpd on
|
chkconfig httpd on
|
||||||
service httpd start
|
service httpd start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: httpd start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Nginx configuration
|
# Nginx configuration
|
||||||
wget $CHOST/$VERSION/nginx.conf -O /etc/nginx/nginx.conf
|
wget $CHOST/$VERSION/nginx.conf -O /etc/nginx/nginx.conf
|
||||||
|
@ -482,21 +490,34 @@ rm -f /etc/nginx/conf.d/vesta_users.conf
|
||||||
touch /etc/nginx/conf.d/vesta_users.conf
|
touch /etc/nginx/conf.d/vesta_users.conf
|
||||||
chkconfig nginx on
|
chkconfig nginx on
|
||||||
service nginx start
|
service nginx start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: nginx start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Vsftpd configuration
|
# Vsftpd configuration
|
||||||
wget $CHOST/$VERSION/vsftpd.conf -O /etc/vsftpd/vsftpd.conf
|
wget $CHOST/$VERSION/vsftpd.conf -O /etc/vsftpd/vsftpd.conf
|
||||||
chkconfig vsftpd on
|
chkconfig vsftpd on
|
||||||
service vsftpd start
|
service vsftpd start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: vsftpd start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# MySQL configuration
|
# MySQL configuration
|
||||||
mpass=$(gen_pass)
|
mpass=$(gen_pass)
|
||||||
if [ "$srv_type" ='micro' ]; then
|
if [ "$srv_type" = 'micro' ]; then
|
||||||
wget $CHOST/$VERSION/mysql-512.cnf -O /etc/my.cnf
|
wget $CHOST/$VERSION/mysql-512.cnf -O /etc/my.cnf
|
||||||
else
|
else
|
||||||
wget $CHOST/$VERSION/mysql.cnf -O /etc/my.cnf
|
wget $CHOST/$VERSION/mysql.cnf -O /etc/my.cnf
|
||||||
fi
|
fi
|
||||||
chkconfig mysqld on
|
chkconfig mysqld on
|
||||||
service mysqld start
|
service mysqld start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: mysqld start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
mysqladmin -u root password $mpass
|
mysqladmin -u root password $mpass
|
||||||
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
|
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
|
||||||
|
|
||||||
|
@ -506,6 +527,10 @@ chown root:named /etc/named.conf
|
||||||
chmod 640 /etc/named.conf
|
chmod 640 /etc/named.conf
|
||||||
chkconfig named on
|
chkconfig named on
|
||||||
service named start
|
service named start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: named start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Exim
|
# Exim
|
||||||
wget $CHOST/$VERSION/exim.conf -O /etc/exim/exim.conf
|
wget $CHOST/$VERSION/exim.conf -O /etc/exim/exim.conf
|
||||||
|
@ -532,6 +557,10 @@ rm -f /etc/alternatives/mta
|
||||||
ln -s /usr/sbin/sendmail.exim /etc/alternatives/mta
|
ln -s /usr/sbin/sendmail.exim /etc/alternatives/mta
|
||||||
chkconfig exim on
|
chkconfig exim on
|
||||||
service exim start
|
service exim start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: exim start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Dovecot configuration
|
# Dovecot configuration
|
||||||
if [ "$release" -eq '5' ]; then
|
if [ "$release" -eq '5' ]; then
|
||||||
|
@ -547,6 +576,10 @@ fi
|
||||||
gpasswd -a dovecot mail
|
gpasswd -a dovecot mail
|
||||||
chkconfig dovecot on
|
chkconfig dovecot on
|
||||||
service dovecot start
|
service dovecot start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: dovecot start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# ClamAV configuration
|
# ClamAV configuration
|
||||||
if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then
|
if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then
|
||||||
|
@ -557,12 +590,22 @@ if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then
|
||||||
/usr/bin/freshclam
|
/usr/bin/freshclam
|
||||||
chkconfig clamd on
|
chkconfig clamd on
|
||||||
service clamd start
|
service clamd start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: clamd start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# SpamAssassin configuration
|
# SpamAssassin configuration
|
||||||
if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then
|
if [ "$srv_type" = 'medium' ] || [ "$srv_type" = 'large' ]; then
|
||||||
chkconfig spamassassin on
|
chkconfig spamassassin on
|
||||||
service spamassassin start
|
service spamassassin start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: spamassassin start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# php configuration
|
# php configuration
|
||||||
|
@ -712,6 +755,10 @@ $VESTA/bin/v-update-sys-rrd
|
||||||
# Start system service
|
# Start system service
|
||||||
chkconfig vesta on
|
chkconfig vesta on
|
||||||
service vesta start
|
service vesta start
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo "Error: vesta start failed"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Send notification to vestacp.com
|
# Send notification to vestacp.com
|
||||||
wget vestacp.com/notify/?$REPO -O /dev/null
|
wget vestacp.com/notify/?$REPO -O /dev/null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue