full pma install

This commit is contained in:
Serghey Rodin 2019-04-15 13:33:09 +03:00
commit 70319b6a94
2 changed files with 73 additions and 58 deletions

View file

@ -83,9 +83,6 @@ gen_pass() {
echo "$PASS"
}
# Defining 32 char blowfish_secret
blowfish_secret=`openssl rand -base64 32`;
# Defining return code check function
check_result() {
if [ $1 -ne 0 ]; then
@ -1045,8 +1042,15 @@ if [ "$mysql" = 'yes' ]; then
if [ "$apache" = 'yes' ]; then
cp -f $vestacp/pma/phpMyAdmin.conf /etc/httpd/conf.d/
fi
mysql < /usr/share/phpMyAdmin/sql/create_tables.sql
p=$(gen_pass)
mysql -e "GRANT ALL ON phpmyadmin.*
TO phpmyadmin@localhost IDENTIFIED BY '$p'"
cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/config.inc.php
sed -i "s#%blowfish_secret#$blowfish_secret#g" /etc/phpMyAdmin/config.inc.php
sed -i "s/%blowfish_secret%/$(gen_pass 32)/g" /etc/phpMyAdmin/config.inc.php
sed -i "s/%phpmyadmin_pass%/$p/g" /etc/phpMyAdmin/config.inc.php
chmod 777 /var/lib/phpMyAdmin/temp
chmod 777 /var/lib/phpMyAdmin/save
fi