From d78a2c0456535a23189865779e1004f85a6ea2fb Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Wed, 8 Oct 2014 16:22:04 +0530 Subject: [PATCH] mysql site update code --- bin/easyengine | 2 ++ src/modules/site/create/ee_mod_setup_wordpress.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 95763feb..548fa0e8 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -628,6 +628,8 @@ elif [ "$EE_FIRST" = "site" ]; then if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then if [ "$EE_SITE_CURRENT_OPTION" = "MYSQL" ]; then EE_DB_NAME=$(grep DB_NAME $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) + EE_DB_USER=$(grep DB_USER $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) + EE_DB_PASS=$(grep DB_PASSWORD $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) fi ee_mod_setup_wordpress fi diff --git a/src/modules/site/create/ee_mod_setup_wordpress.sh b/src/modules/site/create/ee_mod_setup_wordpress.sh index 46cd724a..15901a98 100644 --- a/src/modules/site/create/ee_mod_setup_wordpress.sh +++ b/src/modules/site/create/ee_mod_setup_wordpress.sh @@ -11,7 +11,11 @@ function ee_mod_setup_wordpress() || ee_lib_error "Unable to download WordPress, exit status = " $? # Database setup - ee_mod_setup_database + # if EE_DB_NAME, EE_DB_USER, EE_DB_PASS are empty then setup database for new site + # else current mysql site is to be updated + if [ "EE_DB_NAME" = "" ] && [ "EE_DB_USER" = "" ] && [ "EE_DB_PASS" = "" ]; then + ee_mod_setup_database + fi # Default WordPress prefix or custom prefix if [ $($EE_CONFIG_GET wordpress.prefix) == "true" ];then