Browse Source

Rename variables

bugfixes
Mitesh Shah 11 years ago
parent
commit
2d70c2e73b
  1. 2
      config/easyengine/ee.conf
  2. 6
      src/lib/ee_lib_variables.sh
  3. 6
      src/modules/site/create/ee_mod_setup_database.sh

2
config/easyengine/ee.conf

@ -6,7 +6,7 @@
ip-address =
[mysql]
client-host = localhost
grant-host = localhost
db-name = false
db-user = false

6
src/lib/ee_lib_variables.sh

@ -46,8 +46,8 @@ else
fi
# Find out MySQL client-host to setup grants
if [ -z $($EE_CONFIG_GET mysql.client-host) ]; then
readonly EE_MYSQL_CLIENT_HOST=localhost
if [ -z $($EE_CONFIG_GET mysql.grant-host) ]; then
readonly EE_MYSQL_GRANT_HOST=localhost
else
readonly EE_MYSQL_CLIENT_HOST=$($EE_CONFIG_GET mysql.client-host)
readonly EE_MYSQL_GRANT_HOST=$($EE_CONFIG_GET mysql.grant-host)
fi

6
src/modules/site/create/ee_mod_setup_database.sh

@ -51,16 +51,16 @@ function ee_mod_setup_database()
fi
# Create MySQL database
echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS \nEE_MYSQL_HOST = $EE_MYSQL_HOST \nEE_MYSQL_CLIENT_HOST = $EE_MYSQL_CLIENT_HOST" &>> $EE_COMMAND_LOG
echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS \nEE_MYSQL_HOST = $EE_MYSQL_HOST \nEE_MYSQL_GRANT_HOST = $EE_MYSQL_GRANT_HOST" &>> $EE_COMMAND_LOG
mysql -e "create database \`$EE_DB_NAME\`" \
|| ee_lib_error "Unable to create $EE_DB_NAME database, exit status = " $?
# Create MySQL User
mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_CLIENT_HOST' identified by '$EE_DB_PASS'" \
mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST' identified by '$EE_DB_PASS'" \
|| ee_lib_error "Unable to create $EE_DB_USER database user, exit status = " $?
# Grant permission
mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_CLIENT_HOST'" \
mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST'" \
|| ee_lib_error "Unable to grant privileges for $EE_DB_USER database user, exit status = " $?
mysql -e "flush privileges"
}

Loading…
Cancel
Save