From 4059521039aa934b3fbf2fa8d4d47e7270ebe2d2 Mon Sep 17 00:00:00 2001 From: Maksymilian Potok Date: Thu, 28 Jan 2021 12:39:20 +0100 Subject: [PATCH] modified osInfo --- scripts/sharedFuncs.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/sharedFuncs.sh b/scripts/sharedFuncs.sh index 6f5d356..d53ff03 100755 --- a/scripts/sharedFuncs.sh +++ b/scripts/sharedFuncs.sh @@ -21,15 +21,18 @@ function package_installed() { exit 5 else declare -A osInfo; - osInfo[/etc/redhat-release]=yum upgrade && yum install - osInfo[/etc/arch-release]=pacman -Syu && pacman -S - osInfo[/etc/SuSE-release]=zypper update && zypper install - osInfo[/etc/debian_version]=apt-get update && apt-get install + osInfo[/etc/redhat-release]=yum + osInfo[/etc/SuSE-release]=zypper + osInfo[/etc/debian_version]=apt-get for f in ${!osInfo[@]} do if [[ -f $f ]];then - sudo ${osInfo[$f]} $1 + sudo ${osInfo[$f]} update + sudo ${osInfo[$f]} install $1 + else + sudo pacman -Syu + sudo pacman -S $1 fi done fi