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 -