Skip to content

Instantly share code, notes, and snippets.

@rmahmood19
Created September 27, 2017 22:41
Show Gist options
  • Save rmahmood19/7977b9939202ccab8f9531e455e5d101 to your computer and use it in GitHub Desktop.
Save rmahmood19/7977b9939202ccab8f9531e455e5d101 to your computer and use it in GitHub Desktop.
#!/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