Change-Id: I80474cce8ea2572a3532e8c4479b20f45f2a185c
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
}
function db_exists(){ # (db_name, credential_file)
- RESULT=`mysqlshow --defaults-extra-file="$2" | grep -v Wildcard | grep -o $1` \
- || ! echo "$RESULT" >&2 \
- || exit 1
+ # check credentials
+ mysqlshow --defaults-extra-file="$2" >/dev/null || exit 1
+ RESULT=`mysqlshow --defaults-extra-file="$2" | grep -v Wildcard | grep -o $1`
if [ "$RESULT" == "$1" ]; then
# echo " DB $1 exists"
return 0