#!/bin/bash # # This script expects to be run in the chef-bcpc directory with root under sudo # set -e if [[ -f ./proxy_setup.sh ]]; then . ./proxy_setup.sh fi PROXY_INFO_FILE="/home/vagrant/proxy_info.sh" if [[ -f $PROXY_INFO_FILE ]]; then . $PROXY_INFO_FILE fi # define calling gem with a proxy if necessary if [[ -z $http_proxy ]]; then GEM_PROXY="" else GEM_PROXY="-p $http_proxy" fi if [[ -z "$1" ]]; then BOOTSTRAP_IP=10.0.100.3 else BOOTSTRAP_IP=$1 fi # needed within build_bins which we call if [[ -z "$CURL" ]]; then echo "CURL is not defined" exit fi if dpkg -s chef-server-core 2>/dev/null | grep -q Status.*installed; then echo chef server is installed else dpkg -i cookbooks/bcpc/files/default/bins/chef-server.deb if [ ! -s /etc/opscode/chef-server.rb ]; then if [ ! -d /etc/opscode ]; then mkdir /etc/opscode chown 775 /etc/opscode fi cat > /etc/opscode/chef-server.rb <