Skip to content

Instantly share code, notes, and snippets.

@sankalp-khare
Last active August 29, 2015 14:00
Show Gist options
  • Save sankalp-khare/11284936 to your computer and use it in GitHub Desktop.
Save sankalp-khare/11284936 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author : Sankalp Khare
# Date : [2014-04-25 Fri]
# Installs mongodb for ubuntu/mint
function mongodb_install(){
echo -e "${purple}=========${nc}"
echo -e "${orange}[setup] mongodb${nc}"
echo
if [ -e "/etc/apt/sources.list.d/mongodb.list" ] && [ -e "/usr/bin/mongo" ]
then
echo "It seems like mongodb is already installed. doing nothing."
else
# taken from saas/installation/other/mongodb.sh
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
fi
# steps for other platforms will differ...
}
mongodb_install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment