-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
55 lines (47 loc) · 1.72 KB
/
install.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#----------------------------------------------------------------------
# Shell script to:
# 1. Install chef
# 2. Install the gpo-sw chef repo
# 3. Execute chef in local mode to install gcf dependencies
#
# This script was inspired by and derived from the mytestbed
# slice-service chef project on github. Thanks to them for blazing the
# trail.
#
# TODO: [FIND THE GITHUB URL]
#
# TODO: Take an argument to be appended to the solo json file name.
# For example, an argument of "gcf" would use solo-gcf.json.
# No argument means use solo.json. Not sure what should go
# in that file. Perhaps nothing?
#----------------------------------------------------------------------
# curl -O http://www.gpolab.bbn.com/experiment-support/gposw/aa/install.sh
# curl -O http://www.gpolab.bbn.com/experiment-support/gposw/aa/chef-repo-2.tar.gz
INSTALL_CHEF_URL=https://www.opscode.com/chef/install.sh
if ! type "chef-solo" > /dev/null; then
if type "curl" > /dev/null; then
curl -o getchef.sh "${INSTALL_CHEF_URL}" && bash getchef.sh && rm getchef.sh
elif type "wget" > /dev/null; then
wget "${INSTALL_CHEF_URL}" -O getchef.sh && bash getchef.sh && rm getchef.sh
else
echo "No curl or wget -- help!"
exit 1
fi
fi
REPO_TGZ=http://www.gpolab.bbn.com/experiment-support/gposw/aa/chef-repo.tar.gz
#wget https://github.com/jackhong/chef-repo/archive/master.tar.gz --no-check-certificate -O chef-repo.tar.gz
if type "curl" > /dev/null; then
curl -O "${REPO_TGZ}"
elif type "wget" > /dev/null; then
wget "${REPO_TGZ}"
else
echo "No curl or wget -- help!"
exit 1
fi
rm -rf cookbooks
tar xzf chef-repo.tar.gz
rm chef-repo.tar.gz
#mv chef-repo-master chef-repo
chef-client -z -r "${@}" && cd ..
rm -rf cookbooks