modified osInfo

This commit is contained in:
Maksymilian Potok 2021-01-28 12:39:20 +01:00
parent 38cc6c74a0
commit 4059521039
1 changed files with 8 additions and 5 deletions

View File

@ -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