31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
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 wasn't an option..."
|
|
;;
|
|
esac
|
|
done
|
|
|
|
sudo apt update && apt upgrade -y
|
|
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release -y
|
|
sudo curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
|
|
echo "deb http://security.ubuntu.com/ubuntu jammy-security main" | sudo tee /etc/apt/sources.list.d/jammy-security.list
|
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
|
sudo apt update -y
|
|
sudo apt-get install libssl1.1 -y
|
|
sudo apt install mongodb-org -y
|
|
sudo systemctl start mongod
|
|
sudo systemctl enable mongod
|
|
apt autoremove -y
|