#!/bin/bash while [ 1 ] do procID=`pgrep mysqld` if [ "" == "$procID" ]; then /etc/init.d/mysqld start fi usleep 30000 done &