From 3bee95b5f875ad3289293b8b9f63d4b000321a64 Mon Sep 17 00:00:00 2001 From: Joe Prochazka Date: Fri, 29 Apr 2016 19:30:19 -0400 Subject: [PATCH] Check root password before continuing. --- bash/portal/install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bash/portal/install.sh b/bash/portal/install.sh index 2a5a39c..b6ed483 100755 --- a/bash/portal/install.sh +++ b/bash/portal/install.sh @@ -184,6 +184,14 @@ if [[ $INSTALLED == "n" ]]; then DATABASEHOST="localhost" fi read -p "Password for MySQL root user: " MYSQLROOTPASSWORD + + # Check that the supplied password is correct. + while ! mysql -u root -p$MYSQLROOTPASSWORD -e ";" ; do + echo -e "\033[31m" + echo -e "Unable to connect to the MySQL server using the supplied password.\033[37m" + read -p "Password for MySQL root user: " MYSQLROOTPASSWORD + done + read -p "New Database Name: " DATABASENAME read -p "New Database User Name: " DATABASEUSER read -p "New Database User Password: " DATABASEPASSWORD