#!/bin/bash
check_mariadb(){
if systemctl is-active --quiet mariadb; then
return 0
else
if systemctl start mariadb; then
return 0
else
return 1
fi
fi
}
while true; do
check_mariadb
sleep 10
done