Browse Source

Minor Update on check stack packages

old-stable
harshadyeola 10 years ago
parent
commit
b43549242a
  1. 36
      bin/easyengine
  2. 46
      src/lib/ee_lib_stack_packages.sh

36
bin/easyengine

@ -451,46 +451,20 @@ elif [ "$EE_FIRST" = "site" ]; then
fi fi
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 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_package_check $EE_NGINX_PACKAGE ee_lib_stack_packages nginx
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install nginx || exit $?
fi
fi 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 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_package_check php5-common php5-mysqlnd php5-xmlrpc \ ee_lib_stack_packages php
php5-curl php5-gd php5-cli php5-fpm php5-imap php5-mcrypt php5-xdebug \
php5-memcache memcached php5-geoip
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install php || exit $?
fi
fi fi
if [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then if [ "$EE_SITE_CREATE_OPTION" = "--mysql" ] || [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
mysqladmin ping &>> $EE_COMMAND_LOG ee_lib_stack_packages mysql
if [ $? -ne 0 ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install mysql || exit $?
fi
fi fi
if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then if [ "$EE_SITE_CREATE_OPTION" = "--wp" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdir" ] || [ "$EE_SITE_CREATE_OPTION" = "--wpsubdomain" ]; then
ee_ven_install_wpcli ee_ven_install_wpcli
fi fi
ee_lib_stack_packages postfix
ee_lib_package_check postfix
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install postfix || exit $?
fi
# Lets create HTML|PHP|MySQL website # Lets create HTML|PHP|MySQL website
if [ "$EE_SITE_CREATE_OPTION" = "--html" ] || [ "$EE_SITE_CREATE_OPTION" = "--php" ] || [ "$EE_SITE_CREATE_OPTION" = "--mysql" ]; then if [ "$EE_SITE_CREATE_OPTION" = "--html" ] || [ "$EE_SITE_CREATE_OPTION" = "--php" ] || [ "$EE_SITE_CREATE_OPTION" = "--mysql" ]; then

46
src/lib/ee_lib_stack_packages.sh

@ -0,0 +1,46 @@
# Check the specified package is installed or not
function ee_lib_stack_packages()
{
local ee_stack_package
for ee_stack_package in $@;do
# Check NGINX installed & install if not
if [ "$ee_stack_package" = "nginx" ]
ee_lib_package_check $EE_NGINX_PACKAGE
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install nginx || exit $?
fi
# Check PHP installed & install if not
elif [ "$ee_stack_package" = "php" ]; then
ee_lib_package_check php5-fpm
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install php || exit $?
fi
# Check MySQL installed & install if not
elif [ "$ee_stack_package" = "mysql" ]; then
mysqladmin ping &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install mysql || exit $?
fi
# Check Postfix installed & install if not
elif [ "$ee_stack_package" = "postfix" ]; then
ee_lib_package_check postfix
if [ "$EE_PACKAGE_NAME" != "" ]; then
# The following command creates its own sub-shell
# and our ee_lib_error function only exit from that sub-shell
# so we need to exit from parent shell also
ee stack install postfix || exit $?
fi
fi
done
}
Loading…
Cancel
Save