#Script that checks the status of a process and restarts it, if that #process is down. Should be placed in a cron job. #Digital Ebola #Written for use with HP-UX LLS=`ps -ef |grep process|grep -v grep|awk '{print $2}'` if [ "$LLS" = "" ]; then echo "Process $LLS is down." |mail you@yourmail.com date >> /home/user/llstate.log echo "Process $LLS is down." >> /home/user/state.log /path/to/process else echo "." >> /home/user/upstate.log fi