Browse Source

ee stack remove && ee stack purge

old-stable
Mitesh Shah 11 years ago
parent
commit
674c8239e2
  1. 2
      .travis.yml
  2. 51
      bin/easyengine
  3. 7
      src/lib/ee_lib_autoremove.sh
  4. 6
      src/modules/system/remove/ee_mod_remove_mysql.sh
  5. 6
      src/modules/system/remove/ee_mod_remove_nginx.sh
  6. 6
      src/modules/system/remove/ee_mod_remove_php.sh
  7. 4
      src/modules/system/remove/ee_mod_remove_postfix.sh

2
.travis.yml

@ -24,6 +24,8 @@ script:
- sudo bash -x bin/install.sh $TRAVIS_BRANCH
- sudo ee stack install
- sudo ee stack remove
- sudo ee stack purge
- sudo ee system install nginx
- sudo ee system install php
- sudo ee system install mysql

51
bin/easyengine

@ -108,6 +108,57 @@ then
ee_ven_install_phpmyadmin
ee_ven_install_wpcli
ee_ven_install_utils
# Display success message
ee_lib_echo "Successfully installed all packages"
fi
fi
# EasyEngine remove/purge
if [ "$EE_SECOND" = "remove" ] || [ "$EE_SECOND" = "purge" ]; then
if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ] || [ "$EE_THIRD" = "mysql" ] || [ "$EE_THIRD" = "postfix" ] || [ "$EE_THIRD" = "adminer" ] || [ "$EE_THIRD" = "phpmyadmin" ] || [ "$EE_THIRD" = "wpcli" ] || [ "$EE_THIRD" = "utils" ]; then
# Remove/Purge nginx/php/mysql/postfix package
if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ] || [ "$EE_THIRD" = "mysql" ] || [ "$EE_THIRD" = "postfix" ]; then
ee_mod_remove_$EE_THIRD
fi
# Remove/Purge adminer/phpmyadmin/wpcli/utils
if [ "$EE_THIRD" = "adminer" ] || [ "$EE_THIRD" = "phpmyadmin" ] || [ "$EE_THIRD" = "wpcli" ] || [ "$EE_THIRD" = "utils" ];then
ee_ven_remove_$EE_THIRD
fi
# Execute: apt-get autoremove
ee_lib_autoremove
# Display success message
if [ "$EE_SECOND" = "remove" ];then
ee_lib_echo "$EE_THIRD successfully removed"
elif [ "$EE_SECOND" = "purge" ];then
ee_lib_echo "$EE_THIRD successfully purged"
fi
elif [ "$EE_THIRD" = "" ]; then
# Remove/Purge nginx/php/mysql/postfix package
ee_mod_remove_nginx
ee_mod_remove_php
ee_mod_remove_mysql
ee_mod_remove_postfix
# Install adminer/phpmyadmin/wpcli/utils
ee_ven_remove_adminer
ee_ven_remove_phpmyadmin
ee_ven_remove_wpcli
ee_ven_remove_utils
# Execute: apt-get autoremove
ee_lib_autoremove
# Display success message
if [ "$EE_SECOND" = "remove" ];then
ee_lib_echo "Successfully removed all packages"
elif [ "$EE_SECOND" = "purge" ];then
ee_lib_echo "Successfully purged all packages"
fi
fi
fi
fi

7
src/lib/ee_lib_autoremove.sh

@ -0,0 +1,7 @@
# Execute: apt-get autoremove
function ee_lib_autoremove()
{
ee_lib_echo "Removing unwanted packages, please wait..."
$EE_APT_GET autoremove | tee -ai $EE_COMMAND_LOG
}

6
src/modules/system/remove/ee_mod_remove_mysql.sh

@ -2,9 +2,9 @@
function ee_mod_remove_mysql()
{
ee_lib_echo "Removing MySQL, please wait..."
$EE_APT_GET remove mysql-server mysqltuner percona-toolkit \
|| ee_lib_error "Unable to remove MySQL, exit status = " $?
ee_lib_echo "$EE_SECOND MySQL, please wait..."
$EE_APT_GET $EE_SECOND mysql-server mysqltuner percona-toolkit \
|| ee_lib_error "Unable to $EE_SECOND MySQL, exit status = " $?
# Remove tuning-primer.sh
rm -f /usr/local/bin/tuning-primer.sh

6
src/modules/system/remove/ee_mod_remove_nginx.sh

@ -2,7 +2,7 @@
function ee_mod_remove_nginx()
{
ee_lib_echo "Removing $EE_NGINX_PACKAGE, please wait..."
$EE_APT_GET remove $EE_NGINX_PACKAGE nginx-common \
|| ee_lib_error "Unable to remove $NGINX_PACKAGE, exit status = " $?
ee_lib_echo "$EE_SECOND $EE_NGINX_PACKAGE, please wait..."
$EE_APT_GET $EE_SECOND $EE_NGINX_PACKAGE nginx-common \
|| ee_lib_error "Unable to $EE_SECOND $NGINX_PACKAGE, exit status = " $?
}

6
src/modules/system/remove/ee_mod_remove_php.sh

@ -2,8 +2,8 @@
function ee_mod_remove_php()
{
ee_lib_echo "Removing php5, please wait..."
$EE_APT_GET remove php5-common php5-mysqlnd php5-xmlrpc \
ee_lib_echo "$EE_SECOND php5, please wait..."
$EE_APT_GET $EE_SECOND php5-common php5-mysqlnd php5-xmlrpc \
php5-curl php5-gd php5-cli php5-fpm php5-imap php5-mcrypt php5-xdebug \
php5-memcache memcached || ee_lib_error "Unable to remove php5, exit status = " $?
php5-memcache memcached || ee_lib_error "Unable to $EE_SECOND php5, exit status = " $?
}

4
src/modules/system/remove/ee_mod_remove_postfix.sh

@ -2,6 +2,6 @@
function ee_mod_remove_postfix()
{
ee_lib_echo "Removing Postfix, please wait..."
$EE_APT_GET remove postfix || ee_lib_error "Unable to remove Postfix, exit status = " $?
ee_lib_echo "$EE_SECOND Postfix, please wait..."
$EE_APT_GET $EE_SECOND postfix || ee_lib_error "Unable to $EE_SECOND Postfix, exit status = " $?
}

Loading…
Cancel
Save