Browse Source

Minor fix

old-stable
Mitesh Shah 11 years ago
parent
commit
f5ab59ea2e
  1. 17
      src/lib/ee_lib_install_mysql.sh
  2. 7
      src/lib/ee_lib_setup_mysql.sh
  3. 4
      src/lib/ee_lib_variables.sh

17
src/lib/ee_lib_install_mysql.sh

@ -1,10 +1,12 @@
# Install mysql package # Install MySQL Package
ee_lib_install_mysql() ee_lib_install_mysql()
{ {
# Mysql password only set if mysql is not installed # Check mysql-server is installed or not
# if mysql is installed don't set wrong password in ~/.my.cnf
ee_lib_package_check mysql-server ee_lib_package_check mysql-server
# If mysql-server is not installed
# Then set random mysql password for root user
if [ -n $PACKAGE_NAME ]; then if [ -n $PACKAGE_NAME ]; then
# setting up mysql password # setting up mysql password
@ -13,10 +15,11 @@ ee_lib_install_mysql()
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ee_mysql_auto_pass" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ee_mysql_auto_pass"
# Generate ~/.my.cnf # Generate ~/.my.cnf
echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf4
fi fi
ee_lib_echo "Installing MySQL, Please Wait..." ee_lib_echo "Installing MySQL, please Wait..."
$EE_APT_GET install mysql-server mysqltuner percona-toolkit \ $EE_APT_GET install mysql-server mysqltuner percona-toolkit \
|| ee_lib_error "Unable To Install MySQL" || ee_lib_error "Unable to install MySQL, exit status = " $?
} }

7
src/lib/ee_lib_setup_mysql.sh

@ -1,10 +1,9 @@
# Setup mysql # Setup MySQL
ee_lib_setup_mysql() ee_lib_setup_mysql()
{ {
# personal settings for mysql ee_lib_echo "Setting up MySQL, please wait..."
ee_lib_echo "Updating MySQL Configuration Files, Please Wait..."
# Decrease mysql wait timeout # Decrease mysql wait timeout
sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf
} }

4
src/lib/ee_lib_variables.sh

@ -13,13 +13,11 @@ readonly EE_APT_GET=$($EE_CONFIG_GET system.apt-get-assume-yes | grep -i true &>
if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then
#Specify nginx package #Specify nginx package
readonly EE_NGINX_PACKAGE=nginx-custom readonly EE_NGINX_PACKAGE=nginx-custom
elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then
# Specify nginx package # Specify nginx package
readonly EE_NGINX_PACKAGE=nginx-full readonly EE_NGINX_PACKAGE=nginx-full
# Detect Debian version # Detect Debian version
readonly EE_DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1) readonly EE_DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1)
fi fi
# Find php user-name # Find php user-name
@ -38,4 +36,4 @@ if [ -f ~/.my.cnf ];then
elif [ -f /root/.my.cnf ];then elif [ -f /root/.my.cnf ];then
readonly EE_MYSQL_USER=$(cat /root/.my.cnf | grep user | cut -d'=' -f2) readonly EE_MYSQL_USER=$(cat /root/.my.cnf | grep user | cut -d'=' -f2)
readonly EE_MYSQL_PASS=$(cat /root/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//') readonly EE_MYSQL_PASS=$(cat /root/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//')
fi fi

Loading…
Cancel
Save