From eb6f93386764d63c168f2872490cd9ea60d9a5ec Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Tue, 21 Oct 2014 16:42:21 +0530 Subject: [PATCH] Fix WordPress multisite update --- bin/easyengine | 12 ++++++------ ..._mod_update.sh => ee_mod_update_website.sh} | 18 +++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) rename src/modules/site/update/{ee_mod_update.sh => ee_mod_update_website.sh} (79%) diff --git a/bin/easyengine b/bin/easyengine index 19456b35..78453a46 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -624,30 +624,30 @@ elif [ "$EE_FIRST" = "site" ]; then # Lets update HTML|PHP website if [[ "$EE_SITE_CURRENT_TYPE" = "--html" && "$EE_SITE_CREATE_OPTION" != "--html" ]] || [[ "$EE_SITE_CURRENT_TYPE" = "--php" && "$EE_SITE_CREATE_OPTION" != "--html" && "$EE_SITE_CREATE_OPTION" != "--php" ]]; then # Lets call update function - ee_mod_update + ee_mod_update_website elif [[ "$EE_SITE_CURRENT_TYPE" = "--mysql" && "$EE_SITE_CREATE_OPTION" != "--html" && "$EE_SITE_CREATE_OPTION" != "--php" && "$EE_SITE_CREATE_OPTION" != "--mysql" ]]; then # Lets call update function - ee_mod_update + ee_mod_update_website elif [[ "$EE_SITE_CURRENT_TYPE" = "--wp --basic" || "$EE_SITE_CURRENT_TYPE" = "--wp --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wp --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wp --wpfc" ]] \ && [[ "$EE_SITE_CREATE_OPTION" != "--html" && "$EE_SITE_CREATE_OPTION" != "--php" && "$EE_SITE_CREATE_OPTION" != "--mysql" && "$EE_SITE_CURRENT_TYPE" != "$EE_SITE_UPDATE_TYPE" ]]; then # Lets call update function - ee_mod_update + ee_mod_update_website elif [[ "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --basic" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --wpfc" ]] \ && [[ "$EE_SITE_CREATE_OPTION" != "--html" && "$EE_SITE_CREATE_OPTION" != "--php" && "$EE_SITE_CREATE_OPTION" != "--mysql" && "$EE_SITE_CREATE_OPTION" != "--wp" && "$EE_SITE_CREATE_OPTION" != "--wpsubdomain" && "$EE_SITE_CURRENT_TYPE" != "$EE_SITE_UPDATE_TYPE" ]]; then # Lets call update function - ee_mod_update + ee_mod_update_website elif [[ "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --basic" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --wpfc" ]] \ && [[ "$EE_SITE_CREATE_OPTION" != "--html" && "$EE_SITE_CREATE_OPTION" != "--php" && "$EE_SITE_CREATE_OPTION" != "--mysql" && "$EE_SITE_CREATE_OPTION" != "--wp" && "$EE_SITE_CREATE_OPTION" != "--wpsubdir" && "$EE_SITE_CURRENT_TYPE" != "$EE_SITE_UPDATE_TYPE" ]]; then # Lets call update function - ee_mod_update + ee_mod_update_website fi - if [ "$EE_MOD_UPDATE" = "success" ]; then + if [ "$EE_UPDATE_WEBSITE" = "success" ]; then # Adjust permission ee_lib_permissions diff --git a/src/modules/site/update/ee_mod_update.sh b/src/modules/site/update/ee_mod_update_website.sh similarity index 79% rename from src/modules/site/update/ee_mod_update.sh rename to src/modules/site/update/ee_mod_update_website.sh index 12c77475..148b7342 100644 --- a/src/modules/site/update/ee_mod_update.sh +++ b/src/modules/site/update/ee_mod_update_website.sh @@ -1,6 +1,6 @@ # Update Websites -function ee_mod_update() { +function ee_mod_update_website() { # Let's take backup first ee_mod_site_backup @@ -19,7 +19,7 @@ function ee_mod_update() { &>> /var/www/$EE_DOMAIN/ee-config.php fi - # Use same database when update MySQL website to WordPress + # Use same database when update MySQL website updated to WordPress if [ "$EE_SITE_CURRENT_TYPE" = "--mysql" ]; then # Use same database for WordPress EE_DB_NAME=$(grep DB_NAME $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed "s'htdocs'backup/$EE_DATE/ee-config.php'" 2> /dev/null) | cut -d"'" -f4) @@ -27,7 +27,7 @@ function ee_mod_update() { EE_DB_PASS=$(grep DB_PASSWORD $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed "s'htdocs'backup/$EE_DATE/ee-config.php'" 2> /dev/null) | cut -d"'" -f4) fi - # Setup WordPress + # Setup/Install WordPress for HTML|PHP|MySQL websites if [[ "$EE_SITE_CURRENT_TYPE" != "--wp --basic" && "$EE_SITE_CURRENT_TYPE" != "--wp --wpsc" && "$EE_SITE_CURRENT_TYPE" != "--wp --w3tc" && "$EE_SITE_CURRENT_TYPE" != "--wp --wpfc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --basic" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --wpsc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --w3tc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --wpfc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --basic" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --wpsc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --w3tc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --wpfc" ]] && [[ "$EE_SITE_CREATE_OPTION" = "--wp" || "$EE_SITE_CREATE_OPTION" = "--wpsubdir" || "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]]; then # Setup WordPress @@ -41,10 +41,14 @@ function ee_mod_update() { # Display WordPress cache plugin settings ee_mod_plugin_settings + + # Update WordPress Websites elif [[ "$EE_SITE_CURRENT_TYPE" = "--wp --basic" || "$EE_SITE_CURRENT_TYPE" = "--wp --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wp --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wp --wpfc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --basic" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdir --wpfc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --basic" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --wpsc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --w3tc" || "$EE_SITE_CURRENT_TYPE" = "--wpsubdomain --wpfc" ]]; then - # Setup WordPress Network - if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then - ee_mod_setup_network + # Setup WordPress Network for --wp websites + if [[ "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --basic" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --wpsc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --w3tc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdir --wpfc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --basic" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --wpsc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --w3tc" && "$EE_SITE_CURRENT_TYPE" != "--wpsubdomain --wpfc" ]]; then + if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then + ee_mod_setup_network + fi fi # Install WordPress plugins @@ -63,5 +67,5 @@ function ee_mod_update() { fi # Use this variable to detect and change ownership, reload nginx, - EE_MOD_UPDATE="success" + EE_UPDATE_WEBSITE="success" } \ No newline at end of file