From 5d5c9d616cb9a0253840a0e045cb96fef975fc94 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Thu, 20 Oct 2022 11:01:07 -0700 Subject: [PATCH] Update 'scripts/mongodbinstall.sh' --- scripts/mongodbinstall.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/mongodbinstall.sh b/scripts/mongodbinstall.sh index ca5c88f..f91043f 100644 --- a/scripts/mongodbinstall.sh +++ b/scripts/mongodbinstall.sh @@ -1,13 +1,22 @@ #!/bin/bash -while [ "$go" != 'y' ] && [ "$go" != 'n' ]; do - read -p "Would you like to install MongoDB? (y/n) " go +while true +do + read -r -p "Would you like to install MongoDB? [Y/n] " input + + case $input in + [yY][eE][sS]|[yY]) + break + ;; + [nN][oO]|[nN]) + break + ;; + *) + echo "That wasnt an option..." + ;; + esac done -if [ "$go" == 'n' ]; then - exit -fi - sudo apt update && apt upgrade -y sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release sudo curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -