Browse Source

If MySQL Is Installed Dont Set Wrong Password In ~/.my.cnf

old-stable
Mitesh Shah 11 years ago
parent
commit
b608be4c32
  1. 19
      usr/local/sbin/easyengine

19
usr/local/sbin/easyengine

@ -250,13 +250,20 @@ INSTALLPMA()
MYSQLINSTALLTWEAKS() MYSQLINSTALLTWEAKS()
{ {
# Setting Up MySQL Password # MySQL Password Only Set If MySQL Is Not Installed
MYSQLAUTOPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) # If MySQL Is Installed Dont Set Wrong Password In ~/.my.cnf
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQLAUTOPASS" dpkg -l | grep mysql-server
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQLAUTOPASS"
# Generate ~/.my.cnf if [ $? -ne 0 ]
echo -e "[client]\nuser=root\npassword=$MYSQLAUTOPASS" > ~/.my.cnf then
# Setting Up MySQL Password
MYSQLAUTOPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1)
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQLAUTOPASS"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQLAUTOPASS"
# Generate ~/.my.cnf
echo -e "[client]\nuser=root\npassword=$MYSQLAUTOPASS" > ~/.my.cnf
fi
} }
INSTALLMYSQL() INSTALLMYSQL()

Loading…
Cancel
Save