diff --git a/run.sh b/run.sh index e88b4c75f49453371f25e4f3126c1580a51f0755..c3d1261531d1baafb36e3ebcaa0f3fc2a9c8d4c9 100755 --- a/run.sh +++ b/run.sh @@ -28,15 +28,38 @@ function main () { if [[ ${user_input} == 1 ]] then # Handle for Arch Linux. + echo "Choose a DB type to install:" + echo -e " ${text_cyan}1${text_reset}) MariaDB" + echo -e " ${text_cyan}2${text_reset}) PostgreSQL" + echo "" + read user_input - # Handle for MariaDB install. - echo "Starting MariaDB install for Arch Linux." - echo -e "To continue, press ${text_cyan}enter${text_reset}. Otherwise, hit ${text_cyan}ctrl+c${text_reset} to cancel." - read + # Handle user input. + if [[ ${user_input} == 1 ]] + then + # Handle for MariaDB install. + echo -e "${text_blue}Installing MariaDB for Arch Linux.${text_reset}" + echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}" + echo -e "${text_blue}This may ask for your system password.${text_reset}" + echo -e "${text_blue}To continue, press ${text_cyan}enter${text_blue}. Otherwise, hit ${text_cyan}ctrl+c${text_blue} to cancel.${text_reset}" + read - echo -e "${text_blue}Starting MariaDB installation.${text_reset}" - sudo ./install_mysql.sh --os arch --db mariadb - echo -e "${text_green}MariaDB installation complete.${text_reset}" + echo -e "${text_blue}Starting MariaDB installation.${text_reset}" + sudo ./install_mysql.sh --os arch --db mariadb + echo -e "${text_green}MariaDB setup & installation complete.${text_reset}" + + elif [[ ${user_input} == 2 ]] + then + echo -e "${text_blue}Installing PostgreSQL for Arch Linux.${text_reset}" + echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}" + echo -e "${text_blue}This may ask for your system password.${text_reset}" + echo -e "${text_blue}To continue, press ${text_cyan}enter${text_blue}. Otherwise, hit ${text_cyan}ctrl+c${text_blue} to cancel.${text_reset}" + read + + echo -e "${text_blue}Starting PostgreSQL installation.${text_reset}" + sudo ./install_postgresql.sh --os arch + echo -e "${text_green}PostgreSQL setup & installation complete.${text_reset}" + fi elif [[ ${user_input} == 2 ]] then @@ -44,6 +67,7 @@ function main () { echo "Choose a DB type to install:" echo -e " ${text_cyan}1${text_reset}) MySQL" echo -e " ${text_cyan}2${text_reset}) MariaDB" + echo -e " ${text_cyan}3${text_reset}) PostgreSQL" echo "" read user_input @@ -51,26 +75,31 @@ function main () { if [[ ${user_input} == 1 ]] then # Handle for MySQL install. - echo "Starting MySQL install for Ubuntu." - echo -e "To continue, press ${text_cyan}enter${text_reset}. Otherwise, hit ${text_cyan}ctrl+c${text_reset} to cancel." + echo -e "${text_blue}Installing MySQL for Ubuntu Linux.${text_reset}" + echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}" + echo -e "${text_blue}This may ask for your system password.${text_reset}" + echo -e "${text_blue}To continue, press ${text_cyan}enter${text_blue}. Otherwise, hit ${text_cyan}ctrl+c${text_blue} to cancel.${text_reset}" read echo -e "${text_blue}Starting MySQL installation.${text_reset}" sudo ./install_mysql.sh --os ubuntu --db mysql - echo -e "${text_green}MySQL installation complete.${text_reset}" + echo -e "${text_green}MySQL setup & installation complete.${text_reset}" elif [[ ${user_input} == 2 ]] then # Handle for MariaDB install. - echo "Starting MariaDB install for Ubuntu." - echo -e "To continue, press ${text_cyan}enter${text_reset}. Otherwise, hit ${text_cyan}ctrl+c${text_reset} to cancel." + echo -e "${text_blue}Installing MariaDB for Ubuntu Linux.${text_reset}" + echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}" + echo -e "${text_blue}This may ask for your system password.${text_reset}" + echo -e "${text_blue}To continue, press ${text_cyan}enter${text_blue}. Otherwise, hit ${text_cyan}ctrl+c${text_blue} to cancel.${text_reset}" read echo -e "${text_blue}Starting MariaDB installation.${text_reset}" sudo ./install_mysql.sh --os ubuntu --db mariadb - echo -e "${text_green}MariaDB installation complete.${text_reset}" + echo -e "${text_green}MariaDB setup & installation complete.${text_reset}" else + # Unhandled type. echo -e "${text_orange}Unknown option entered.${text_reset}" fi diff --git a/src/install_mysql.sh b/src/install_mysql.sh index 5ffdc9a7d8d58497e6c038a80a8b111c18eafdf6..7fd80aad7ae2c26940542ccb4aa9c95cdd928c69 100755 --- a/src/install_mysql.sh +++ b/src/install_mysql.sh @@ -76,9 +76,6 @@ function main () { # Installation logic for Arch Linux systems. ## function install_arch_mariadb () { - echo -e "${text_blue}Installing MariaDB for Arch Linux.${text_reset}" - echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}" - echo -e "${text_blue}This may ask for your system password.${text_reset}" # Install MariaDB. pacman -Syu mariadb --noconfirm > /dev/null @@ -104,12 +101,12 @@ function install_ubuntu_mysql () { echo -e "${text_blue}This may ask for your system password.${text_reset}" # Install MySQL. - sudo apt-get update > /dev/null 2>&1 + sudo apt-get update > /dev/null 2>&1 sudo apt-get install mysql-server mysql-client -y # Start MariaDB service and set to start on boot. - systemctl enable mysql.service - systemctl start mysql.service + systemctl enable mysql.service > /dev/null + systemctl start mysql.service > /dev/null echo "" get_user_confirmation "Allow password login with root user? Recommended for local dev/testing setups."