This commit is contained in:
Luk Lu
2019-12-16 10:05:22 +08:00
parent bcf85c06f2
commit 809dbd39fb
12 changed files with 56 additions and 35 deletions

18
install-mongodb.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
echo "Usage: setup.sh [VERSION]"
echo "Example: setup.sh 4.2"
if [ v$1 != v ]
then
export Version=$1
else
export Version=4.2
fi
curl https://www.mongodb.org/static/pgp/server-$Version.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/$Version main" | sudo tee /etc/apt/sources.list.d/mongodb-org-$Version.list
sudo apt update
sudo apt install mongodb-org -y
echo "Enable as system service..."
sudo systemctl enable mongod