-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f306849
commit 95e261e
Showing
2 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
#Checks for archlinux | ||
OS_INFO=$(cat /etc/os-release | grep -i 'archlinux') | ||
if [ "$?" -eq 0 ]; then | ||
pkg_srch=$(pacman -Ss | grep ${1}) | ||
|
||
if [ "$?" -eq 0 ]; then | ||
sudo pacman -Syu ${1} 2> /dev/null | ||
else | ||
exit 1 | ||
fi | ||
fi | ||
|
||
#Checks for Ubuntu | ||
OS_INFO=$(cat /etc/os-release | grep -i 'Ubuntu') | ||
if [ "$?" -eq 0 ]; then | ||
pkg_srch=$(apt-get update && apt list | grep ${1}) | ||
|
||
if [ "$?" -eq 0 ]; then | ||
sudo apt-get install -y ${1} 2> /dev/null | ||
else | ||
exit 1 | ||
fi | ||
fi | ||
|
||
#Checks for fedora | ||
OS_INFO=$(cat /etc/os-release | grep -i 'fedora') | ||
if [ "$?" -eq 0 ]; then | ||
pkg_srch=$(yum list | grep ${1}) | ||
|
||
if [ "$?" -eq 0 ]; then | ||
sudo yum update && yum install -y ${1} 2> /dev/null | ||
else | ||
exit 1 | ||
fi | ||
fi | ||
|
||
#Will Check for gentoo | ||
# OS_INFO=$(cat /etc/os-release | grep -i 'gentoo') | ||
# if [ "$?" -eq 0 ]; then | ||
# emerge -s ${1} | ||
# | ||
# if [ "$?" -eq 0 ]; then | ||
# emerge ${1} 2> /dev/null | ||
# else | ||
# exit 1 | ||
# fi | ||
# fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters