mirror of
https://github.com/joglomedia/LEMPer.git
synced 2026-04-13 08:28:21 +00:00
41 lines
1.3 KiB
Bash
Executable File
41 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Include decorator
|
|
if [ "$(type -t run)" != "function" ]; then
|
|
BASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )
|
|
. ${BASEDIR}/helper.sh
|
|
fi
|
|
|
|
echo -e "\nCleaning up machine..."
|
|
|
|
# Remove Apache2 service if exist
|
|
if [[ -n $(which apache2) ]]; then
|
|
warning "It seems Apache web server installed on this machine. We should remove it!"
|
|
read -t 10 -p "Press [Enter] to continue..." </dev/tty
|
|
echo "Uninstall existing Apache web server..."
|
|
run service apache2 stop
|
|
#killall -9 apache2
|
|
run apt-get --purge remove -y apache2 apache2-doc apache2-utils \
|
|
apache2.2-common apache2.2-bin apache2-mpm-prefork \
|
|
apache2-doc apache2-mpm-worker >> lemper.log 2>&1
|
|
fi
|
|
|
|
# Remove Mysql service if exist
|
|
if [[ -n $(which mysql) ]]; then
|
|
warning "It seems Mysql database server installed on this machine. We should remove it!"
|
|
echo "Backup your database before continue!"
|
|
|
|
echo -n "Surely, remove existing MySQL database server? [y/n]: "
|
|
read rmMysql
|
|
|
|
if [[ "$rmMysql" == Y* || "$rmMysql" == y* ]]; then
|
|
echo "Uninstall existing MySQL database server..."
|
|
run service mysqld stop
|
|
|
|
#killall -9 mysql
|
|
run apt-get --purge remove -y mysql-client mysql-server mysql-common >> lemper.log 2>&1
|
|
fi
|
|
fi
|
|
|
|
status "Machine cleaned up..."
|