mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 13:01:52 -07:00
Minor changes
This commit is contained in:
parent
00ca250b2c
commit
b56b96f749
1 changed files with 22 additions and 22 deletions
|
@ -258,7 +258,7 @@ fi
|
||||||
# Brief Info #
|
# Brief Info #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Printing nice ascii aslogo
|
# Printing nice ASCII logo
|
||||||
clear
|
clear
|
||||||
echo
|
echo
|
||||||
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
|
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
|
||||||
|
@ -490,7 +490,7 @@ mv /var/lib/mysql $vst_backups/mysql/mysql_datadir > /dev/null 2>&1
|
||||||
cp -r /etc/mysql/* $vst_backups/mysql > /dev/null 2>&1
|
cp -r /etc/mysql/* $vst_backups/mysql > /dev/null 2>&1
|
||||||
mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1
|
mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1
|
||||||
|
|
||||||
# Backup vesta
|
# Backup Vesta
|
||||||
service vesta stop > /dev/null 2>&1
|
service vesta stop > /dev/null 2>&1
|
||||||
cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1
|
cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1
|
||||||
apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1
|
apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1
|
||||||
|
@ -602,8 +602,8 @@ rm -f /etc/cron.d/awstats
|
||||||
# Set directory color
|
# Set directory color
|
||||||
echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
|
echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
|
||||||
|
|
||||||
# Register /sbin/nologin
|
# Register /usr/sbin/nologin
|
||||||
echo "/sbin/nologin" >> /etc/shells
|
echo "/usr/sbin/nologin" >> /etc/shells
|
||||||
|
|
||||||
# NTP Synchronization
|
# NTP Synchronization
|
||||||
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
|
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
|
||||||
|
@ -639,10 +639,10 @@ echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile
|
||||||
echo 'export PATH' >> /root/.bash_profile
|
echo 'export PATH' >> /root/.bash_profile
|
||||||
source /root/.bash_profile
|
source /root/.bash_profile
|
||||||
|
|
||||||
# Configuring logrotate for vesta logs
|
# Configuring logrotate for Vesta logs
|
||||||
wget $vestacp/logrotate/vesta -O /etc/logrotate.d/vesta
|
wget $vestacp/logrotate/vesta -O /etc/logrotate.d/vesta
|
||||||
|
|
||||||
# Buidling directory tree and creating some blank files for vesta
|
# Buidling directory tree and creating some blank files for Vesta
|
||||||
mkdir -p $VESTA/conf $VESTA/log $VESTA/ssl $VESTA/data/ips \
|
mkdir -p $VESTA/conf $VESTA/log $VESTA/ssl $VESTA/data/ips \
|
||||||
$VESTA/data/queue $VESTA/data/users $VESTA/data/firewall \
|
$VESTA/data/queue $VESTA/data/users $VESTA/data/firewall \
|
||||||
$VESTA/data/sessions
|
$VESTA/data/sessions
|
||||||
|
@ -658,12 +658,12 @@ ln -s $VESTA/log /var/log/vesta
|
||||||
chown admin:admin $VESTA/data/sessions
|
chown admin:admin $VESTA/data/sessions
|
||||||
chmod 770 $VESTA/data/sessions
|
chmod 770 $VESTA/data/sessions
|
||||||
|
|
||||||
# Generating vesta configuration
|
# Generating Vesta configuration
|
||||||
rm -f $VESTA/conf/vesta.conf 2>/dev/null
|
rm -f $VESTA/conf/vesta.conf 2>/dev/null
|
||||||
touch $VESTA/conf/vesta.conf
|
touch $VESTA/conf/vesta.conf
|
||||||
chmod 660 $VESTA/conf/vesta.conf
|
chmod 660 $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
# WEB stack
|
# Web stack
|
||||||
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
|
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
|
||||||
echo "WEB_SYSTEM='apache2'" >> $VESTA/conf/vesta.conf
|
echo "WEB_SYSTEM='apache2'" >> $VESTA/conf/vesta.conf
|
||||||
echo "WEB_RGROUPS='www-data'" >> $VESTA/conf/vesta.conf
|
echo "WEB_RGROUPS='www-data'" >> $VESTA/conf/vesta.conf
|
||||||
|
@ -867,7 +867,7 @@ done
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Configure VSFTPD #
|
# Configure Vsftpd #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
if [ "$vsftpd" = 'yes' ]; then
|
if [ "$vsftpd" = 'yes' ]; then
|
||||||
|
@ -904,14 +904,14 @@ if [ "$mysql" = 'yes' ]; then
|
||||||
mycnf="my-large.cnf"
|
mycnf="my-large.cnf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# MySQL configuration
|
# Configuring MySQL/MariaDB
|
||||||
wget $vestacp/mysql/$mycnf -O /etc/mysql/my.cnf
|
wget $vestacp/mysql/$mycnf -O /etc/mysql/my.cnf
|
||||||
mysql_install_db
|
mysql_install_db
|
||||||
update-rc.d mysql defaults
|
update-rc.d mysql defaults
|
||||||
service mysql start
|
service mysql start
|
||||||
check_result $? "mysql start failed"
|
check_result $? "mysql start failed"
|
||||||
|
|
||||||
# Securing MySQL installation
|
# Securing MySQL/MariaDB installation
|
||||||
mysqladmin -u root password $vpass
|
mysqladmin -u root password $vpass
|
||||||
echo -e "[client]\npassword='$vpass'\n" > /root/.my.cnf
|
echo -e "[client]\npassword='$vpass'\n" > /root/.my.cnf
|
||||||
chmod 600 /root/.my.cnf
|
chmod 600 /root/.my.cnf
|
||||||
|
@ -1049,7 +1049,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Configure RoundCube #
|
# Configure Roundcube #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
|
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
|
||||||
|
@ -1114,16 +1114,16 @@ if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" = 'yes' ]; then
|
||||||
groupdel admin > /dev/null 2>&1
|
groupdel admin > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Adding vesta account
|
# Adding Vesta admin account
|
||||||
$VESTA/bin/v-add-user admin $vpass $email default System Administrator
|
$VESTA/bin/v-add-user admin $vpass $email default System Administrator
|
||||||
check_result $? "can't create admin user"
|
check_result $? "can't create admin user"
|
||||||
$VESTA/bin/v-change-user-shell admin bash
|
$VESTA/bin/v-change-user-shell admin bash
|
||||||
$VESTA/bin/v-change-user-language admin $lang
|
$VESTA/bin/v-change-user-language admin $lang
|
||||||
|
|
||||||
# Configuring system ips
|
# Configuring system IPs
|
||||||
$VESTA/bin/v-update-sys-ip
|
$VESTA/bin/v-update-sys-ip
|
||||||
|
|
||||||
# Get main ip
|
# Get main IP
|
||||||
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
|
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
|
||||||
|
|
||||||
# Firewall configuration
|
# Firewall configuration
|
||||||
|
@ -1131,20 +1131,20 @@ if [ "$iptables" = 'yes' ]; then
|
||||||
$VESTA/bin/v-update-firewall
|
$VESTA/bin/v-update-firewall
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get public ip
|
# Get public IP
|
||||||
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
|
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
|
||||||
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
|
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
|
||||||
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
|
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
|
||||||
ip=$pub_ip
|
ip=$pub_ip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configuring mysql host
|
# Configuring MySQL host
|
||||||
if [ "$mysql" = 'yes' ]; then
|
if [ "$mysql" = 'yes' ]; then
|
||||||
$VESTA/bin/v-add-database-host mysql localhost root $vpass
|
$VESTA/bin/v-add-database-host mysql localhost root $vpass
|
||||||
$VESTA/bin/v-add-database admin default default $(gen_pass) mysql
|
$VESTA/bin/v-add-database admin default default $(gen_pass) mysql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configuring pgsql host
|
# Configuring PostgreSQL host
|
||||||
if [ "$postgresql" = 'yes' ]; then
|
if [ "$postgresql" = 'yes' ]; then
|
||||||
$VESTA/bin/v-add-database-host pgsql localhost postgres $vpass
|
$VESTA/bin/v-add-database-host pgsql localhost postgres $vpass
|
||||||
$VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
|
$VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
|
||||||
|
@ -1171,7 +1171,7 @@ command="sudo $VESTA/bin/v-update-sys-rrd"
|
||||||
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
|
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
|
||||||
service cron restart
|
service cron restart
|
||||||
|
|
||||||
# Building inititall rrd images
|
# Building initital rrd images
|
||||||
$VESTA/bin/v-update-sys-rrd
|
$VESTA/bin/v-update-sys-rrd
|
||||||
|
|
||||||
# Enabling file system quota
|
# Enabling file system quota
|
||||||
|
@ -1179,7 +1179,7 @@ if [ "$quota" = 'yes' ]; then
|
||||||
$VESTA/bin/v-add-sys-quota
|
$VESTA/bin/v-add-sys-quota
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Starting vesta service
|
# Starting Vesta service
|
||||||
update-rc.d vesta defaults
|
update-rc.d vesta defaults
|
||||||
service vesta start
|
service vesta start
|
||||||
check_result $? "vesta start failed"
|
check_result $? "vesta start failed"
|
||||||
|
@ -1199,7 +1199,7 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
|
||||||
# Sending install notification to vestacp.com
|
# Sending install notification to vestacp.com
|
||||||
wget vestacp.com/notify/?$codename -O /dev/null -q
|
wget vestacp.com/notify/?$codename -O /dev/null -q
|
||||||
|
|
||||||
# Comparing hostname and ip
|
# Comparing hostname and IP
|
||||||
host_ip=$(host $servername| head -n 1 | awk '{print $NF}')
|
host_ip=$(host $servername| head -n 1 | awk '{print $NF}')
|
||||||
if [ "$host_ip" = "$ip" ]; then
|
if [ "$host_ip" = "$ip" ]; then
|
||||||
ip="$servername"
|
ip="$servername"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue