From 3e16e4b6e0cff12f303daf741e3e3a8fc1e0897f Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 15 Mar 2022 19:46:16 -0400 Subject: [PATCH] test --- 00-Checking_Dependencies.sh | 2 ++ common/functions.sh | 22 ++++++++++++++++++++++ install/install.sh | 6 ------ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/00-Checking_Dependencies.sh b/00-Checking_Dependencies.sh index c10f6f2..cee4625 100644 --- a/00-Checking_Dependencies.sh +++ b/00-Checking_Dependencies.sh @@ -5,6 +5,8 @@ SCRIPTDIR=$(dirname $0) source "$SCRIPTDIR/common/colors.sh" source "$SCRIPTDIR/common/functions.sh" +pkgmgr_update + ## Start File Loop ## For .dependency files In The dependencies Directory DEPENDENCIESALL="$SCRIPTDIR/dependencies/*.dep" diff --git a/common/functions.sh b/common/functions.sh index 49666b2..2a63c70 100644 --- a/common/functions.sh +++ b/common/functions.sh @@ -45,6 +45,28 @@ get_pkg_mgr() { fi } +pkgmgr_update(){ + + # Get Command language + PKG_MANAGER=$( get_pkg_mgr ) + + # Run apt-get update for distros that use apt-get + if [ "$PKG_MANAGER" == "apt-get" ] ; then + if should_apt_last_update ; then + "${PKG_MANAGER} update" + fi + fi + + if [ "$PKG_MANAGER" == "apt-get" ] ; then + "$PKG_MANAGER" full-upgrade -y + elif [ "$PKG_MANAGER" == "dnf" ] ; then + "$PKG_MANAGER" update + elif [ "$PKG_MANAGER" == "yum" ] ; then + "$PKG_MANAGER" update + fi + +} + install_pkg() { # package to install diff --git a/install/install.sh b/install/install.sh index 4a27d25..c3692a2 100644 --- a/install/install.sh +++ b/install/install.sh @@ -1,13 +1,7 @@ #!/bin/bash s ## These are the colors used throughout the script. -COL_RED='\e[1;31m%s\e[0m\n' -COL_GREEN='\e[1;32m%s\e[0m\n' COL_YELLOW='\e[1;33m%s\e[0m\n' -COL_BLUE='\e[1;34m%s\e[0m\n' -COL_MAGENTA='\e[1;35m%s\e[0m\n' -COL_CYAN='\e[1;36m%s\e[0m\n' -COL_ORANGE='\e[38;5;166m%s\e[0m\n' COL_LIGHT_BLUE='\e[38;5;111m%s\e[0m\n' is_command() {