[enh] remote mysql: show an error when connection fails

This commit is contained in:
Pierre-Louis Bonicoli 2014-03-26 02:52:52 +01:00
parent c05f1bddd2
commit ca8cd30437
2 changed files with 14 additions and 3 deletions

View File

@ -51,13 +51,17 @@ check_mysql()
if [ "`mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" -h"$MYSQL_HOST" -Bse 'SELECT "OK";' 2>/dev/null`" = "OK" ]; then if [ "`mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" -h"$MYSQL_HOST" -Bse 'SELECT "OK";' 2>/dev/null`" = "OK" ]; then
STATE=`expr $STATE + 1` STATE=`expr $STATE + 1`
else else
db_input high alternc/remote_mysql_error || true db_input high alternc/retry_remote_mysql || true
if [ $? -eq 30 ]; then if [ $? -eq 30 ]; then
db_input high alternc/remote_mysql_error || true
db_go || true
exit 4 exit 4
fi fi
db_go db_go
db_get alternc/remote_mysql_error || true db_get alternc/retry_remote_mysql || true
if [ "$RET" = "false" ]; then if [ "$RET" = "false" ]; then
db_input high alternc/remote_mysql_error || true
db_go || true
exit 4 exit 4
fi fi
fi fi

View File

@ -241,7 +241,7 @@ _Description: Use a remote MySQL server?
Please confirm you want to use a remote Mysql Server. Please confirm you want to use a remote Mysql Server.
If not, AlternC cannot be installed. If not, AlternC cannot be installed.
Template: alternc/remote_mysql_error Template: alternc/retry_remote_mysql
Type: boolean Type: boolean
_Description: MySQL connection error. Try again? _Description: MySQL connection error. Try again?
Remote connection to the MySQL server failed. Remote connection to the MySQL server failed.
@ -254,3 +254,10 @@ _Description: Private IP detected, use it anyway?
this is an expected situation, since the server might not be reachable this is an expected situation, since the server might not be reachable
from outside your network. from outside your network.
Template: alternc/remote_mysql_error
Type: error
_Description: Remote mysql: connection error
Connection to the remote MySQL server failed.
.
This is a fatal error and will cause the package installation
to fail.