From 50343fe1c674187493ecf424b0e9016328b0fe58 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 4 Feb 2025 22:53:35 +0900 Subject: [PATCH] minor adjustment --- install-scripts/Global_functions.sh | 5 ++++- install.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/install-scripts/Global_functions.sh b/install-scripts/Global_functions.sh index f8a3e6c..896dc10 100755 --- a/install-scripts/Global_functions.sh +++ b/install-scripts/Global_functions.sh @@ -48,7 +48,10 @@ show_progress() { # Function for installing packages with a progress bar -install_package() { +install_package() { + if sudo dpkg -l | grep -q -w "$1" ; then + echo -e "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..." + else ( stdbuf -oL sudo apt-get install -y "$1" 2>&1 ) >> "$LOG" 2>&1 & diff --git a/install.sh b/install.sh index cbeb3ff..09a478e 100755 --- a/install.sh +++ b/install.sh @@ -72,7 +72,9 @@ fi read -p "${CAT} Have you edited your /etc/apt/sources.list? ${YELLOW}[Very Important else script will fail]${RESET} (y/n): ${RESET}" proceed2 if [ "$proceed2" != "y" ]; then + printf "\n%.0s" {1..2} echo "Installation aborted! Kindly edit your ${YELLOW}sources.list${RESET} first. Refer to readme." + printf "\n%.0s" {1..2} exit 1 fi