Skip to content

Commit c6db011

Browse files
committed
Simplified MongoDB install.
1 parent 3ce586d commit c6db011

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

128 - lib-mongodb.sh

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
#!/bin/bash
22
#
3-
# Installs MongoDB from 10gen.com repository.
3+
# Installs MongoDB.
44
#
55
# Copyright (c) 2010 Filip Wasilewski <[email protected]>.
66
#
77
# My ref: http://www.linode.com/?r=aadfce9845055011e00f0c6c9a5c01158c452deb
88

9-
function system_configure_mongodb_repository {
10-
RELEASE=`lsb_release -sr | sed 's/\.0/\./'`
11-
echo -e "\n##MongoDB repository by 10gen\ndeb http://downloads.mongodb.org/distros/ubuntu $RELEASE 10gen\n" >> /etc/apt/sources.list
12-
apt-key adv --keyserver pgp.mit.edu --recv 7F0CEB10 || apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
13-
aptitude update
14-
}
159

1610
function mongodb_install {
17-
BASE_DIRECTORY=$1 # /var/lib or /srv
18-
aptitude -y install mongodb-stable
19-
if [ -n "$BASE_DIRECTORY" ]; then
20-
DATA_DIRECTORY="$BASE_DIRECTORY/mongodb"
21-
mkdir -p "$DATA_DIRECTORY"
22-
chown mongodb:mongodb "$DATA_DIRECTORY"
23-
sed -i "s:dbpath=.*:dbpath=$DATA_DIRECTORY:" /etc/mongodb.conf
24-
fi;
25-
touch /tmp/restart-mongodb
11+
aptitude -y install mongodb
2612
}

0 commit comments

Comments
 (0)