Skip to content

Commit

Permalink
Test for existence of mysql binary during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
infostreams committed May 15, 2019
1 parent c610fa0 commit 625fcb3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/db-server
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ add_server()
code="${?}"
delete_config "${test}"

if [ "${code}" -eq 1 ]; then
echo "${COLOR_RED}Could not connect to database. Please try again.${COLOR_NC}"
continue
if [ "${code}" -eq 127 ]; then
echo "${COLOR_RED}Could not find mysql binary.${COLOR_NC}"
else
echo "${COLOR_GREEN}Successfully connected to database. Writing config.${COLOR_NC}"
if [ "${code}" -eq 1 ]; then
echo "${COLOR_RED}Could not connect to database. Please try again.${COLOR_NC}"
continue
else
echo "${COLOR_GREEN}Successfully connected to database. Writing config.${COLOR_NC}"
fi
fi

write_config "${server}"
Expand Down

0 comments on commit 625fcb3

Please sign in to comment.