#!/usr/bin/env bash # Cleanup server # Min. Requirement : GNU/Linux Ubuntu 14.04 # Last Build : 01/08/2019 # Author : ESLabs.ID (eslabs.id@gmail.com) # Since Version : 1.0.0 # Include helper functions. if [ "$(type -t run)" != "function" ]; then BASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) # shellchechk source=scripts/helper.sh # shellcheck disable=SC1090 . "${BASEDIR}/helper.sh" fi # Define scripts directory. if echo "${BASEDIR}" | grep -qwE "scripts"; then SCRIPTS_DIR="${BASEDIR}" else SCRIPTS_DIR="${BASEDIR}/scripts" fi # Make sure only root can run this installer script. requires_root echo "Cleaning up server..." echo "" # Fix broken install, first? run dpkg --configure -a run apt-get --fix-broken install # Remove Apache2 service if exists. if [[ -n $(command -v apache2) ]]; then warning -e "\nIt seems Apache web server installed on this server." echo "Any other HTTP web server will be removed, otherwise they will conflict." read -t 15 -rp "Press [Enter] to continue..."