From d5958942cd9fef9d84128e44aa07524208a96fc7 Mon Sep 17 00:00:00 2001 From: xiaosong Date: Sat, 26 Aug 2017 13:25:55 +0800 Subject: [PATCH] fix --- lemp.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lemp.sh b/lemp.sh index 93935a7..341ad42 100755 --- a/lemp.sh +++ b/lemp.sh @@ -37,12 +37,14 @@ while :; do echo if [[ ! $mariadb_yn =~ ^[y,n]$ ]]; then echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}" else - while :; do echo - read -p "Please type MariaDB root password:(Default lemp.sh press Enter) " MariaDB_ROOT_PWD - [ -z "$MariaDB_ROOT_PWD" ] && MariaDB_ROOT_PWD="lemp.sh" - [ -n "`echo $MariaDB_ROOT_PWD | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and & ${CEND}"; continue; } - break; - done + if [ "$mariadb_yn" == 'y' ]; then + while :; do echo + read -p "Please type MariaDB root password:(Default lemp.sh press Enter) " MariaDB_ROOT_PWD + [ -z "$MariaDB_ROOT_PWD" ] && MariaDB_ROOT_PWD="lemp.sh" + [ -n "`echo $MariaDB_ROOT_PWD | grep '[+|&]'`" ] && { echo "${CWARNING}input error,not contain a plus sign (+) and & ${CEND}"; continue; } + break; + done + fi fi done