};i++))
do
if [ "$1" == "${error[$i]}" ]
then
$MYSQLCMD -e "stop slave;set global sql_slave_skip_counter=1;start slave;"
else
echo "Mysql slave is failed,errorno is $1"
fi
done
}
judge_salve(){
status_array
if [ "${status[0]}" == "Yes" -a "${status[1]}" == "Yes" -a "${status[3]}" == "0" ];then
echo "Mysql slave is ok"
else
status_error ${status[2]}
fi
}
main(){
while true
do
is_run
judge_slave
sleep 30
done
}
main