X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=database_utils%2Finstall-db-server.sh;h=0599b57147fd334a87f3e374a302a4d4920e98c2;hb=b0c600d21ad65893f5e7ab4522565e8f66e195e9;hp=62738fd26952c6cb33b7e8a8eb8ac11feabefce7;hpb=e52c0b78e2254096c27c5e150a707eaaaba428e5;p=osm%2Fopenvim.git diff --git a/database_utils/install-db-server.sh b/database_utils/install-db-server.sh index 62738fd..0599b57 100755 --- a/database_utils/install-db-server.sh +++ b/database_utils/install-db-server.sh @@ -102,7 +102,7 @@ function _create_db(){ || exit 1 echo " Database '${DB_NAME}' created, user '$DB_USER' password '$DB_PASS'" DIRNAME=$(dirname $(readlink -f ${BASH_SOURCE[0]})) - ${DIRNAME}/init_mano_db.sh -u"$DB_USER" -p"$DB_PASS" -d"$DB_NAME" -P"$DB_PORT" $DB_HOST_PARAM \ + ${DIRNAME}/init_vim_db.sh -u"$DB_USER" -p"$DB_PASS" -d"$DB_NAME" -P"$DB_PORT" $DB_HOST_PARAM \ || ! echo "Error initializing database '$DB_NAME'" >&2 \ || exit 1 } @@ -125,7 +125,7 @@ function _update_db(){ || exit 1 echo " Granted privileges to user '$DB_USER' password '$DB_PASS' to existing database '${DB_NAME}'" DIRNAME=$(dirname $(readlink -f ${BASH_SOURCE[0]})) - ${DIRNAME}/migrate_mano_db.sh -u"$DB_USER" -p"$DB_PASS" -d"$DB_NAME" -P"$DB_PORT" $DB_HOST_PARAM \ + ${DIRNAME}/migrate_vim_db.sh -u"$DB_USER" -p"$DB_PASS" -d"$DB_NAME" -P"$DB_PORT" $DB_HOST_PARAM \ || ! echo "Error updating database '$DB_NAME'" >&2 \ || exit 1 } @@ -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