Feature 7318 check vim-create connectivity and credentials
[osm/RO.git] / database_utils / init_mano_db.sh
index 29a3ed0..147ea38 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 ##
-# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U.
 # This file is part of openmano
 # All Rights Reserved.
 #
@@ -161,7 +161,8 @@ DBHOST_="" && [ -n "$DBHOST" ] && DBHOST_="-h$DBHOST"
 DBPORT_="-P$DBPORT"
 
 echo "    loading ${DIRNAME}/mano_db_structure.sql"
-sed -e "s/{{mano_db}}/$DBNAME/" ${DIRNAME}/mano_db_structure.sql |  mysql $DEF_EXTRA_FILE_PARAM
+sed -e "s/{{mano_db}}/$DBNAME/" ${DIRNAME}/mano_db_structure.sql | mysql $DEF_EXTRA_FILE_PARAM ||
+    ! echo "ERROR at init $DBNAME" || exit 1
 
 echo "    migrage database version"
 # echo "${DIRNAME}/migrate_mano_db.sh $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ -d$DBNAME $QUIET_MODE $DB_VERSION"