#!/bin/bash
/etc/init.d/mysqld status > /alidata/log/mysqld20220414.log
var=$(cat /alidata/log/mysqld20220414.log)
if [[ $var =~ "ERROR" ]]
# ERROR! MySQL is not running
then
/etc/init.d/mysqld start
#service mysqld start
fi
#!/bin/bash
/etc/init.d/mysqld status > /alidata/log/mysqld20220414.log
var=$(cat /alidata/log/mysqld20220414.log)
if [[ $var =~ "ERROR" ]]
# ERROR! MySQL is not running
then
/etc/init.d/mysqld start
#service mysqld start
fi