Browse Source

Merge pull request #324 from brennentsmith/master

Critical error during site deletion when using external MySQL host
bugfixes
Gaurav Ashtikar 10 years ago
parent
commit
c90204278c
  1. 2
      bin/easyengine
  2. 4
      src/modules/site/delete/ee_mod_delete_database.sh

2
bin/easyengine

@ -541,7 +541,7 @@ elif [ "$EE_FIRST" = "site" ]; then
# Check the $EE_DOMAIN exist or not
if [ ! -f /etc/nginx/sites-available/$EE_DOMAIN ]; then
ee_lib_error "$EE_DOMAIN not exist, exit status = " $?
ee_lib_error "$EE_DOMAIN does not exist, exit status = " $?
fi
# Use default whenever possible

4
src/modules/site/delete/ee_mod_delete_database.sh

@ -10,7 +10,7 @@ function ee_mod_delete_database()
local ee_db_user=$(grep DB_USER /var/www/$EE_DOMAIN/*-config.php | cut -d"'" -f4)
local ee_db_pass=$(grep DB_PASS /var/www/$EE_DOMAIN/*-config.php | cut -d"'" -f4)
local ee_db_host=$(grep DB_HOST /var/www/$EE_DOMAIN/*-config.php | cut -d"'" -f4)
ee_lib_echo_escape " DB_NAME = $ee_db_name \n DB_USER = $ee_db_user \n DB_HOST = $ee_db_host"
ee_lib_echo_escape " DB_NAME = $ee_db_name \n DB_USER = $ee_db_user \n DB_HOST = $ee_db_host \n GRANT_HOST = $EE_MYSQL_GRANT_HOST"
if [ "$1" = "--no-prompt" ];then
# Delete database without any prompt
@ -30,7 +30,7 @@ function ee_mod_delete_database()
# Never drop root user
if [ "$ee_db_user" != "root" ]; then
# Drop database user
mysql -e "drop user '$ee_db_user'@'$ee_db_host'" \
mysql -e "drop user '$ee_db_user'@'$EE_MYSQL_GRANT_HOST'" \
|| ee_lib_error "Unable to drop database user $ee_db_user, exit status = " $?
# Flush privileges
mysql -e "flush privileges" \

Loading…
Cancel
Save