fix: db available check getting stuck with empty password

This commit is contained in:
Stefan Brunecker
2021-10-16 00:46:26 +02:00
parent 3e8585394d
commit ae201814fa

View File

@@ -292,8 +292,9 @@ check_availability() {
;; ;;
"mysql" ) "mysql" )
COUNTER=0 COUNTER=0
export MYSQL_PWD=${dbpass}
while true; do while true; do
mysqlcmd='mysql -u'${dbuser}' -P '${dbport}' -h '${dbhost}' -p'${dbpass} mysqlcmd='mysql -u'${dbuser}' -P '${dbport}' -h '${dbhost}
out="$($mysqlcmd -e "SELECT COUNT(*) FROM information_schema.FILES;" 2>&1)" out="$($mysqlcmd -e "SELECT COUNT(*) FROM information_schema.FILES;" 2>&1)"
echo "$out" | grep -E "COUNT|Enter" 2>&1 > /dev/null echo "$out" | grep -E "COUNT|Enter" 2>&1 > /dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then