Browse Source

functions created

bugfixes
harshadyeola 10 years ago
parent
commit
7fbdefc8a4
  1. 57
      src/modules/site/ee_mod_site_option.sh
  2. 40
      src/modules/site/ee_mod_site_packages.sh

57
src/modules/site/ee_mod_site_option.sh

@ -1,34 +1,37 @@
# Auto switch site options
if [ "$EE_SITE_CREATE_OPTION" = "--basic" ] || [ "$EE_SITE_CREATE_OPTION" = "--w3tc" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsc" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpfc" ]; then
if [ "$EE_SITE_CACHE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdirectory" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdom" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdomain" ]; then
EE_SITE_CREATE_OPTION=$EE_FIFTH
EE_SITE_CACHE_OPTION=$EE_FOURTH
else
EE_SITE_CREATE_OPTION=--wp
EE_SITE_CACHE_OPTION=$EE_FOURTH
function ee_mod_site_option()
{
if [ "$EE_SITE_CREATE_OPTION" = "--basic" ] || [ "$EE_SITE_CREATE_OPTION" = "--w3tc" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsc" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpfc" ]; then
if [ "$EE_SITE_CACHE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdirectory" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdom" ] || [ "$EE_SITE_CACHE_OPTION" = "--wpsubdomain" ]; then
EE_SITE_CREATE_OPTION=$EE_FIFTH
EE_SITE_CACHE_OPTION=$EE_FOURTH
else
EE_SITE_CREATE_OPTION=--wp
EE_SITE_CACHE_OPTION=$EE_FOURTH
fi
fi
fi
# WordPresss subdirectory variables
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdirectory" ]; then
EE_SITE_CREATE_OPTION="--wpsubdir"
EE_NETWORK_ACTIVATE="--network"
fi
# WordPresss subdirectory variables
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdirectory" ]; then
EE_SITE_CREATE_OPTION="--wpsubdir"
EE_NETWORK_ACTIVATE="--network"
fi
# WordPress sub-domain variables
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdom" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
EE_SITE_CREATE_OPTION="--wpsubdomain"
EE_NETWORK_ACTIVATE="--network"
EE_WP_SUBDOMAIN="--subdomains"
fi
# WordPress sub-domain variables
if [ "$EE_SITE_CREATE_OPTION" = "--wpsubdom" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
EE_SITE_CREATE_OPTION="--wpsubdomain"
EE_NETWORK_ACTIVATE="--network"
EE_WP_SUBDOMAIN="--subdomains"
fi
# Use default whenever possible
if [ "$EE_SITE_CREATE_OPTION" = "" ]; then
EE_SITE_CREATE_OPTION=--html
fi
# Use default whenever possible
if [ "$EE_SITE_CREATE_OPTION" = "" ]; then
EE_SITE_CREATE_OPTION=--html
fi
# For WordPress sites if $EE_SITE_CACHE_OPTION is empty then used --basic as a $EE_SITE_CACHE_OPTION
if [ "$EE_SITE_CACHE_OPTION" = "" ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ "$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
EE_SITE_CACHE_OPTION=--basic
fi
# For WordPress sites if $EE_SITE_CACHE_OPTION is empty then used --basic as a $EE_SITE_CACHE_OPTION
if [ "$EE_SITE_CACHE_OPTION" = "" ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ "$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
EE_SITE_CACHE_OPTION=--basic
fi
}

40
src/modules/site/ee_mod_site_packages.sh

@ -1,21 +1,25 @@
# 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
# 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
function ee_mod_site_packages()
{
# 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
# 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
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
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
}

Loading…
Cancel
Save