Created
September 27, 2017 22:41
-
-
Save rmahmood19/7977b9939202ccab8f9531e455e5d101 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
#"Author : Reaz Mahmood" | |
# Website: http://rmahmood.tech | |
if [ $# -eq 0 ] ; then | |
echo " Please provide a package name as parameter." | |
echo " Usage Example : $0 foo1" | |
exit 2 | |
fi | |
for i in $* ; do | |
{ | |
if rpm -q --quiet $i 2>&1 > /dev/null ; then | |
echo -e "\033[31m$i\033[0m Already installed" | |
else | |
yum -y install $i | |
fi | |
} | |
done | |
exit 0 | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment