posted by Full-stack Developer 2013. 11. 20. 14:04

#!/bin/bash

mySqlPSCnt=$(pgrep mysqld | wc -l);

if [ "$mySqlPSCnt" == 0 ];

then

        echo "mySQL is down.";

else

        echo "mySQL is alive.";

fi


referebce : https://gist.github.com/mheadd/5571023