Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
better check for localhost and better stack check before PMA install.
  • Loading branch information
QROkes committed Jun 23, 2019
1 parent 79755d2 commit 2ba1f32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 6 additions & 0 deletions lib/general
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 1 addition & 5 deletions lib/sites
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions plugins/stack
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2ba1f32

Please sign in to comment.