Here is my final script, I used a different version of the ps command just cause it required one less grep command so I figured less commands is better and I did the if backwards cause I could never get the = "" to work for some odd reason, I tried like 20 ways but hey this works. The only thing is when you run it manually you get a long list from the ps but hey this runs in a cron so I don't care I never see it. I also got it to send me an email when it happens so that I can sort of check up on the server, if its crashing to much its not that good. The restartMsg.txt just contains a sort little restart message.
#!/bin/bash
#script checks and restarts apache if required
if ps U layout | grep httpd
then
echo "Layouts server up and running"
exit 0
else
#restart server
echo "Layouts server down, restarting server"
cat restartMsg.txt | mail -s "Layouts failed on host.domain.com" root
/home/layout/bin/apachectl restart
echo "Layouts server restarted"
fi
Hope someone else might find the script useful, I know its small and easy to write but you never know.
Thanks Steve for the help