From 2ba1f3250ffbce9f6282540831506e31ecba6d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Sat, 22 Jun 2019 18:24:18 -0600 Subject: [PATCH] minor fixes better check for localhost and better stack check before PMA install. --- lib/general | 6 ++++++ lib/sites | 6 +----- plugins/stack | 6 ++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/general b/lib/general index 46e9133..b1fdb79 100644 --- a/lib/general +++ b/lib/general @@ -56,6 +56,12 @@ check_for_php() { exit 1 fi } +check_for_mysql() { + if [[ $(conf_read mysql) != "true" ]]; then + echo "${red}[ERROR] MySQL is required and not found! ${end}" + exit 1 + fi +} conf_read() { diff --git a/lib/sites b/lib/sites index e9626f7..b75598c 100644 --- a/lib/sites +++ b/lib/sites @@ -158,12 +158,8 @@ wpinstall() { echo "" [[ $type == [2345] ]] || read -p "Database Host [localhost]:" dbhost dbhost=${dbhost:-localhost} + [[ ${dbhost,,} == "localhost" && $setupmysql == [yY] ]] && check_for_mysql - if [[ $dbhost == "localhost" && $setupmysql == [yY] && $(conf_read mysql) != "true" ]]; then - echo "${red}[ERROR] MySQL is not installed or localhost was not found!${blu}" - done="0" - [[ $type == 1 ]] && continue 1 || exit 1 - fi # Check if localhost or external DB if [[ $dbhost != "localhost" && $setupmysql == [yY] ]]; then if [[ $(conf_read mysql-client) != "true" ]]; then diff --git a/plugins/stack b/plugins/stack index 60b1681..f0d1f8e 100644 --- a/plugins/stack +++ b/plugins/stack @@ -342,15 +342,13 @@ elif [[ -n $php ]]; then elif [[ -n $mysql ]]; then if [[ $(conf_read mysql) != "true" ]]; then mysql_install - [[ -z $notools ]] && stack -pma + [[ -z $notools && $(conf_read mysql) == "true" && $(conf_read php) == "true" && $(conf_read nginx) == "true" && $(conf_read nginx-tool) == "true" ]] && stack -pma || echo "${gre}PhpMyAdmin was NOT installed!${end}" messagend_install dbpass else echo "${red}MySQL is already installed!${end}" if [[ $(conf_read mysql-tool) != "true" && -z $notools ]]; then stack -pma - echo "${gre}" - [[ $(conf_read mysql-tool) == "true" ]] && echo "MySQL Tools has been re-installed!" - echo "${end}" + [[ $(conf_read mysql-tool) == "true" ]] && echo "${gre}MySQL Tools has been re-installed!${end}" fi fi