Add 'scripts/mongodbinstall.sh'
This commit is contained in:
parent
22fb34371a
commit
7d45e4e9d5
18
scripts/mongodbinstall.sh
Normal file
18
scripts/mongodbinstall.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
while [ "$go" != 'y' ] && [ "$go" != 'n' ]; do
|
||||
read -p "Would you like to install MongoDB? (y/n) " go
|
||||
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 -
|
||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
|
||||
sudo apt update
|
||||
sudo apt install mongodb-org -y
|
||||
sudo systemctl start mongod
|
||||
sudo systemctl enable mongod
|
Reference in New Issue
Block a user