-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap
executable file
·36 lines (30 loc) · 1.22 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
function explain_pkg {
printf "$1\t\t$2\n"
}
function show_usage {
printf "Usage: $0 <package>\n\n"
explain_pkg "deps" "install dependencies - this should be run first"
explain_pkg "mongodb" "download and install MongoDB to /opt/mongodb (ATTENTION: it is for x64)"
explain_pkg "nginx" "build and install Nginx from source - it will be installed to /opt/nginx"
explain_pkg "openvpn" "install OpenVPN and set up the server"
explain_pkg "python" "install pythonbrew and build Python 2.7.2 from source via pythonbrew (installed to home directory of the specified user)"
explain_pkg "ruby" "install RVM and build Ruby 1.9.3 from source via RVM (installed to home directory of the specified user)"
explain_pkg "user" "create user with sudo priviledge and copy necessary config files"
explain_pkg "vim" "build and install Vim 7.3 from source"
}
PACKAGE=$1
shift
if [ -z $PACKAGE ]
then
show_usage
exit 1
fi
if [[ $PACKAGE != "deps" && ! -f /var/cache/DEPS_INSTALLED ]]
then
echo "You need to run the following command before performing any further operation:"
printf "\t$0 deps\n"
exit 1
fi
export NUM_OF_CORES=`cat /proc/cpuinfo | grep processor | wc -l`
$PACKAGE/setup.sh $@