fix issue at install-db-server.sh 65/1665/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 24 Apr 2017 16:37:49 +0000 (18:37 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 24 Apr 2017 16:43:04 +0000 (17:43 +0100)
Change-Id: I044f51e3e36e2112410e10c33916e69c4581c92c
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
database_utils/install-db-server.sh

index 49ab7ea..5f1c563 100755 (executable)
@@ -141,9 +141,9 @@ echo '
 }
 
 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