|
|
@@ -1024,8 +1024,9 @@ if [ "$mysql" = 'yes' ]; then
|
|
|
fi
|
|
|
|
|
|
# Securing MySQL installation
|
|
|
- mysqladmin -u root password $vpass
|
|
|
- echo -e "[client]\npassword='$vpass'\n" > /root/.my.cnf
|
|
|
+ mpass=$(gen_pass)
|
|
|
+ mysqladmin -u root password $mpass
|
|
|
+ echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
|
|
|
chmod 600 /root/.my.cnf
|
|
|
mysql -e "DELETE FROM mysql.user WHERE User=''"
|
|
|
mysql -e "DROP DATABASE test" >/dev/null 2>&1
|
|
|
@@ -1047,9 +1048,10 @@ fi
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
if [ "$postgresql" = 'yes' ]; then
|
|
|
+ ppass=$(gen_pass)
|
|
|
if [ $release -eq 5 ]; then
|
|
|
service postgresql start
|
|
|
- sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
|
|
|
+ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
|
|
|
service postgresql stop
|
|
|
cp -f $vestacp/postgresql/pg_hba.conf /var/lib/pgsql/data/
|
|
|
service postgresql start
|
|
|
@@ -1057,7 +1059,7 @@ if [ "$postgresql" = 'yes' ]; then
|
|
|
service postgresql initdb
|
|
|
cp -f $vestacp/postgresql/pg_hba.conf /var/lib/pgsql/data/
|
|
|
service postgresql start
|
|
|
- sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
|
|
|
+ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
|
|
|
fi
|
|
|
# Configuring phpPgAdmin
|
|
|
if [ "$apache" = 'yes' ]; then
|
|
|
@@ -1289,13 +1291,13 @@ fi
|
|
|
|
|
|
# Configuring MySQL/MariaDB host
|
|
|
if [ "$mysql" = 'yes' ]; then
|
|
|
- $VESTA/bin/v-add-database-host mysql localhost root $vpass
|
|
|
+ $VESTA/bin/v-add-database-host mysql localhost root $mpass
|
|
|
$VESTA/bin/v-add-database admin default default $(gen_pass) mysql
|
|
|
fi
|
|
|
|
|
|
# Configuring PostgreSQL host
|
|
|
if [ "$postgresql" = 'yes' ]; then
|
|
|
- $VESTA/bin/v-add-database-host pgsql localhost postgres $vpass
|
|
|
+ $VESTA/bin/v-add-database-host pgsql localhost postgres $ppass
|
|
|
$VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
|
|
|
fi
|
|
|
|