#/bin/bash function hasinstall { r=$(rpm -qa "$1") if [ $r ] then return 1 else return 0 fi }
mysql="mysql-server"
hasinstall $mysql
r=$?
if [ $r -eq 1 ] then : echo "$mysql was installed" else echo "$mysql was not installed" yum install mysql mysql-server mysql-devel service mysqld start fi #add User to Mysql database echo "INFORM:Enter database root password" mysql -uroot -p -hlocalhost </etc/cloud/mysql/adduser.sql