@ -421,25 +421,8 @@ elif [ "$EE_FIRST" = "site" ]; then
# Auto switch site options
ee_mod_site_option
if [ "$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_CREATE_OPTION" = "--wpsubdomain" ]; then
# Check & Install NGINX Packages
ee_lib_stack_packages nginx
fi
if [ "$EE_SITE_CREATE_OPTION" = "--php" ] || [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
# Check & Install PHP Packages
ee_lib_stack_packages php
fi
if [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
# Check & Install Percona MySQL Packages
ee_lib_stack_packages mysql
fi
if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
# Install WP-CLI
ee_ven_install_wpcli
fi
# Check & Install Postfix Packages
ee_lib_stack_packages postfix
# Install required packages
ee_mod_site_packages
# Lets create HTML|PHP|MySQL website
if [ "$EE_SITE_CREATE_OPTION" = "--html" ] || [ "$EE_SITE_CREATE_OPTION" = "--php" ] || [ "$EE_SITE_CREATE_OPTION" = "--mysql" ]; then
@ -609,6 +592,7 @@ elif [ "$EE_FIRST" = "site" ]; then
ls /etc/nginx/sites-available/$EE_DOMAIN &> /dev/null \
|| ee_lib_error "The $EE_DOMAIN is not found in /etc/nginx/sites-available, exit status = " $?
# Update WordPress user password
if [ "$EE_SITE_CREATE_OPTION" = "--password" ]; then
ee_mod_site_update_password
else
@ -625,44 +609,34 @@ elif [ "$EE_FIRST" = "site" ]; then
fi
# Install required packages
if [ "$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_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_lib_stack_packages nginx
fi
if [ "$EE_SITE_CREATE_OPTION" = "--php" ] || [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_lib_stack_packages php
fi
if [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_lib_stack_packages mysql
fi
if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_ven_install_wpcli
fi
ee_lib_stack_packages postfix
ee_mod_site_packages
# Lets update HTML|PHP|MySQL website
if [ "$EE_SITE_CURRENT_OPTION" = "HTML" ] || [ "$EE_SITE_CURRENT_OPTION" = "PHP" ] || [ "$EE_SITE_CURRENT_OPTION" = "MYSQL" ]; then
# Update NGINX configuration for $EE_DOMAIN
if [[ "$EE_SITE_CREATE_OPTION" = "--php" && "$EE_SITE_CURRENT_OPTION" != "PHP" ]] || [[ "$EE_SITE_CREATE_OPTION" = "--mysql" && "$EE_SITE_CURRENT_OPTION" != "MYSQL" ]] \
|| [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then
# Update NGINX
ee_mod_update_domain
fi
# Setup WordPress
if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then
ee_mod_setup_wordpress
fi
# Setup WordPress Network
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_mod_setup_network
fi
# Install WordPress plugins
if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then
# Install WordPress plugins
ee_mod_plugin_nginx_helper
fi
ee_mod_update_cache
# Update cache plugins
ee_mod_update_plugins
# Setup MySQL database
if [[ "$EE_SITE_CREATE_OPTION" = "--mysql" && "$EE_SITE_CURRENT_OPTION" != "MYSQL" ]]; then
@ -689,16 +663,17 @@ elif [ "$EE_FIRST" = "site" ]; then
|| [[ "$EE_SITE_CACHE_OPTION" = "--w3tc" && "$EE_SITE_CURRENT_OPTION" != "WPSINGLE W3 TOTAL CACHE" ]] \
|| [[ "$EE_SITE_CACHE_OPTION" = "--wpsc" && "$EE_SITE_CURRENT_OPTION" != "WPSINGLE WP SUPER CACHE" ]] \
|| [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then
# Update NGINX
# Update NGINX configuration for $EE_DOMAIN
ee_mod_update_domain
else
ee_lib_error "Site already, $EE_SITE_CREATE_OPTION $EE_SITE_CACHE_OPTION, exit status =" $?
fi
# Setup WordPress Network
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_mod_setup_network
fi
ee_mod_update_cache
# Update cache plugins
ee_mod_update_plugins
elif [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDIR BASIC" ] || [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDIR W3 TOTAL CACHE" ] \
|| [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDIR FAST CGI" ] || [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDIR WP SUPER CACHE" ] && [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ]; then
@ -706,13 +681,13 @@ elif [ "$EE_FIRST" = "site" ]; then
|| [[ "$EE_SITE_CACHE_OPTION" = "--wpfc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDIR FAST CGI" ]] \
|| [[ "$EE_SITE_CACHE_OPTION" = "--w3tc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDIR W3 TOTAL CACHE" ]] \
|| [[ "$EE_SITE_CACHE_OPTION" = "--wpsc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDIR WP SUPER CACHE" ]]; then
# Update NGINX
# Update NGINX configuration for $EE_DOMAIN
ee_mod_update_domain
else
ee_lib_error "Site already, $EE_SITE_CREATE_OPTION $EE_SITE_CACHE_OPTION, exit status =" $?
fi
ee_mod_update_cache
# Update cache plugins
ee_mod_update_plugins
elif [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDOMAIN BASIC" ] || [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDOMAIN W3 TOTAL CACHE" ] \
|| [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDOMAIN FAST CGI" ] || [ "$EE_SITE_CURRENT_OPTION" = "WPSUBDOMAIN WP SUPER CACHE" ] && [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
@ -720,13 +695,13 @@ elif [ "$EE_FIRST" = "site" ]; then
|| [[ "$EE_SITE_CACHE_OPTION" = "--wpfc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDOMAIN FAST CGI" ]] \
|| [[ "$EE_SITE_CACHE_OPTION" = "--w3tc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDOMAIN W3 TOTAL CACHE" ]] \
|| [[ "$EE_SITE_CACHE_OPTION" = "--wpsc" && "$EE_SITE_CURRENT_OPTION" != "WPSUBDOMAIN WP SUPER CACHE" ]]; then
# Update NGINX
# Update NGINX configuration for $EE_DOMAIN
ee_mod_update_domain
else
ee_lib_error "Site already, $EE_SITE_CREATE_OPTION $EE_SITE_CACHE_OPTION, exit status =" $?
fi
ee_mod_update_cache
# Update cache plugins
ee_mod_update_plugins
else
ee_lib_error "Invalid update parameters, Use proper parameters, exit status =" $?
@ -747,7 +722,7 @@ elif [ "$EE_FIRST" = "site" ]; then
# Display logs for websites
ee_mod_site_log ${@:3}
#EasyEngine cd
# EasyEngine cd
elif [ "$EE_SECOND" = "cd" ]; then
# Check the website name is empty or not
EE_DOMAIN_CHECK=$EE_THIRD
@ -885,10 +860,11 @@ elif [ "$EE_FIRST" = "secure" ]; then
ee_lib_echo_escape "\t--ip\tUpdate whitelist IP address"
fi
# Clean cache
# Clean NGINX FastCGI, Memcache, OPcache cache
elif [ "$EE_FIRST" = "clean" ]; then
ee_mod_clean ${@:2}
# Import MySQL slow log to Anememoter
elif [ "$EE_FIRST" = "import-slow-log" ];then
ee_lib_import_slow_log