fixed error loop

Fixed error loop when data is incorrect for external db in WP unattended.
This commit is contained in:
Cristhian Martínez Ochoa 2018-04-26 18:51:06 -06:00
parent aad142a3ca
commit 765e9c4b0b
2 changed files with 4 additions and 1 deletions

View file

@ -204,6 +204,8 @@ wpinstall() {
sudo mysql --connect-timeout=10 --user=root -p$ROOT_PASS -e "quit"
if [[ $? != "0" ]]; then
done="0"
# Remove the Unattended feature and ask for values.
[[ $wp == [2345] ]] && wp=1
echo "${red}============================================"
echo " [Error]: Database conection failed."
echo "============================================${blu}"
@ -214,6 +216,7 @@ wpinstall() {
sudo mysql --connect-timeout=10 -h "$dburl" -P "$dbport" -u"$dburoot" -p"$dbproot" -e "quit"
if [[ $? != "0" ]]; then
done="0"
[[ $wp == [2345] ]] && wp=1
echo "${red}============================================"
echo " [Error]: Database conection failed."
echo "============================================${blu}"

View file

@ -62,7 +62,7 @@ fi
[[ $cache == "-subdomain" && $value == "false" ]] && subdomflag="0"
# Evaluate if site to create is WP ( 0 = noWP, 1 = WP, 2 = WP with default values, 3 = WP with custom values, 4 = MySQL with default values, 3 = MySQL with custom values )
# Evaluate if site to create is WP ( 0 = noWP, 1 = WP, 2 = WP with default values, 3 = WP with custom values, 4 = MySQL with default values, 5 = MySQL with custom values )
wp="0"
if [[ $type == "-wp" || $type == "-wpsubdir" || $type == "-wpsubdom" || $type == "-mysql" || $domain == "-mysql" ]]; then
[[ $type == "-mysql" || $domain == "-mysql" ]] || wp="1"