Browse Source

Fix WordPress multisite update

bugfixes
Mitesh Shah 10 years ago
parent
commit
eb6f933867
  1. 12
      bin/easyengine
  2. 18
      src/modules/site/update/ee_mod_update_website.sh

12
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

18
src/modules/site/update/ee_mod_update.sh → 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"
}
Loading…
Cancel
Save