Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- USER="da_admin"
- PASSWD=$(grep "^passwd=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2)
- mysql --user="${USER}" --password="${PASSWD}" -e exit 2>/dev/null
- SQLSTATUS=`echo $?`
- if [ $SQLSTATUS -ne "0" ]; then
- echo MySQL is down!
- /usr/bin/killall mysqld
- /etc/init.d/mysqld restart
- fi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement