From 6d067f45f64a0eea49fe718b3688901be80fa8b2 Mon Sep 17 00:00:00 2001 From: Edi Septriyanto Date: Wed, 30 Aug 2017 23:36:52 +0700 Subject: [PATCH] bug fix --- scripts/remove_apache.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/remove_apache.sh b/scripts/remove_apache.sh index 8bb02cc..cd80605 100755 --- a/scripts/remove_apache.sh +++ b/scripts/remove_apache.sh @@ -1,7 +1,17 @@ #!/usr/bin/env bash # Remove Apache2 & mysql services if exist -echo "Uninstall existing Webserver (Apache) and MySQL server..." -killall apache2 && killall mysql -apt-get --purge remove -y apache2 apache2-doc apache2-utils apache2.2-common apache2.2-bin apache2-mpm-prefork apache2-doc apache2-mpm-worker mysql-client mysql-server mysql-common + +if [[ -n $(which apache2) ]]; then + echo "Uninstall existing Apache web server..." + killall -9 apache2 + apt-get --purge remove -y apache2 apache2-doc apache2-utils apache2.2-common apache2.2-bin apache2-mpm-prefork apache2-doc apache2-mpm-worker +fi + +if [[ -n $(which mysql) ]]; then + echo "Uninstall existing MySQL database server..." + killall -9 mysql + apt-get --purge remove -y mysql-client mysql-server mysql-common +fi + apt-get autoremove -y