From 9637565b4d23cd8583384499f7520efd4a90bcbe Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 18 Aug 2014 11:12:47 +0200 Subject: [PATCH] MT#8117 fix b7f74b0737. Move sipwise user connection check earlier --- ngcp-update-db-schema | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ngcp-update-db-schema b/ngcp-update-db-schema index b120ef30..6a3124cb 100755 --- a/ngcp-update-db-schema +++ b/ngcp-update-db-schema @@ -43,6 +43,12 @@ if [ -z "${SIPWISE_DB_PASSWORD}" ] ; then exit 1 fi +# check connection with sipwise user +if ! mysql -usipwise -p${SIPWISE_DB_PASSWORD} -e 'SELECT 1;' 1>/dev/null 2>/dev/null ; then + echo 'Error: cant connect to local MySQL with sipwise user' >&2 + exit 1 +fi + # support automated installation if [ -n "$AUTOMATED_INSTALL_MODE" ] ; then echo "Running in automated installation mode, ignoring check for empty db_schema." @@ -63,12 +69,6 @@ else fi fi -# check connection with sipwise user -if ! mysql -usipwise -p${SIPWISE_DB_PASSWORD} -e 'SELECT 1;' 1>/dev/null 2>/dev/null ; then - echo 'Error: cant connect to local MySQL with sipwise user' >&2 - exit 1 -fi - if ! mysql -usipwise -p${SIPWISE_DB_PASSWORD} -e 'use ngcp;' 2>/dev/null ; then mysql -usipwise -p${SIPWISE_DB_PASSWORD} < /usr/share/ngcp-db-schema/db_scripts/init/0005_create_ngcp.up fi