From 5c0d319ba021d975812cc89ad57f26ece5fceaed Mon Sep 17 00:00:00 2001 From: Brennen Smith Date: Tue, 14 Oct 2014 16:04:18 -0700 Subject: [PATCH 1/3] Fixed site deletion when using external MySQL host --- src/modules/site/delete/ee_mod_delete_database.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/site/delete/ee_mod_delete_database.sh b/src/modules/site/delete/ee_mod_delete_database.sh index 9fa59443..dcd7e825 100644 --- a/src/modules/site/delete/ee_mod_delete_database.sh +++ b/src/modules/site/delete/ee_mod_delete_database.sh @@ -12,6 +12,11 @@ function ee_mod_delete_database() 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" + if [ "$EE_MYSQL_GRANT_HOST" != "localhost" ]; then + # If MySQL grant host is set, use that value instead + ee_db_host=$EE_MYSQL_GRANT_HOST + fi + if [ "$1" = "--no-prompt" ];then # Delete database without any prompt local ee_prompt="y" From 43a873d11f6622044362ce9aaa468b83760399f8 Mon Sep 17 00:00:00 2001 From: Brennen Smith Date: Tue, 14 Oct 2014 16:28:59 -0700 Subject: [PATCH 2/3] Typo when deleting non-existent site. --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 3120bb3d..481b4678 100644 --- a/bin/easyengine +++ b/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 From 02372e291708aba6b95ec047f98ac302653ba471 Mon Sep 17 00:00:00 2001 From: Brennen Smith Date: Wed, 15 Oct 2014 08:16:02 -0700 Subject: [PATCH 3/3] Use Global Grant Host variable instead of local. Dialog is updated to show Grant Host during deletion process. --- src/modules/site/delete/ee_mod_delete_database.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/site/delete/ee_mod_delete_database.sh b/src/modules/site/delete/ee_mod_delete_database.sh index dcd7e825..290c2331 100644 --- a/src/modules/site/delete/ee_mod_delete_database.sh +++ b/src/modules/site/delete/ee_mod_delete_database.sh @@ -10,12 +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" - - if [ "$EE_MYSQL_GRANT_HOST" != "localhost" ]; then - # If MySQL grant host is set, use that value instead - ee_db_host=$EE_MYSQL_GRANT_HOST - fi + 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 @@ -35,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" \