it should be obvious your bash script is made like mysql is available. but many people are using docker and of course there is no mysql or mysql-admin binary. everything has to be called via "docker exec" and the next problem is, that you are using the hostname from the mysql-server-variables, which is sub-optimal, when it comes to docker, because docker hostnames change everytime you restart the container, unless you add a fixed hostname, which is don´t do, because there is no need for that.
so maybe your intention is that everybody who wants to use your tool create a new image with your script inside, but why should be someone do that ? switch from one mysql/mariadb version to another would be impossible without rebuilding a new image.
so my advise: create a 2nd bash script, that is especially made for people running mysql in docker.
there are only a view things to change, than it should work....
it should be obvious your bash script is made like mysql is available. but many people are using docker and of course there is no mysql or mysql-admin binary. everything has to be called via "docker exec" and the next problem is, that you are using the hostname from the mysql-server-variables, which is sub-optimal, when it comes to docker, because docker hostnames change everytime you restart the container, unless you add a fixed hostname, which is don´t do, because there is no need for that. so maybe your intention is that everybody who wants to use your tool create a new image with your script inside, but why should be someone do that ? switch from one mysql/mariadb version to another would be impossible without rebuilding a new image. so my advise: create a 2nd bash script, that is especially made for people running mysql in docker. there are only a view things to change, than it should work....