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 exit 5
else else
declare -A osInfo; declare -A osInfo;
osInfo[/etc/redhat-release]=yum upgrade && yum install osInfo[/etc/redhat-release]=yum
osInfo[/etc/arch-release]=pacman -Syu && pacman -S osInfo[/etc/SuSE-release]=zypper
osInfo[/etc/SuSE-release]=zypper update && zypper install osInfo[/etc/debian_version]=apt-get
osInfo[/etc/debian_version]=apt-get update && apt-get install
for f in ${!osInfo[@]} for f in ${!osInfo[@]}
do do
if [[ -f $f ]];then 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 fi
done done
fi fi