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
'Programming > Bash shell' 카테고리의 다른 글
get array size/length in bash shell (0) | 2013.11.21 |
---|---|
calculateion in bash shell (0) | 2013.11.20 |
check if mysql database exists in bash shell (0) | 2013.11.20 |
Using shell script to control in mySQL (0) | 2013.11.19 |
optional parameter expansions in bash shell (0) | 2013.11.19 |