MT#8117 fix b7f74b0737. Move sipwise user connection check earlier

changes/61/61/1
Victor Seva 12 years ago
parent 750d85410b
commit 9637565b4d

@ -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

Loading…
Cancel
Save