<commit_before>#!/bin/bash

REQUIRED="CHEF_SERVER CHEF_VALIDATOR"
for r in $REQUIRED; do
    if [[ -z ${!r} ]]; then
        echo Environment variable $r required but not set 1>&2
        exit 22
    fi
done

CHEF_ENVIRONMENT=${CHEF_ENVIRONMENT:-_default}
DEBIAN_FRONTEND=noninteractive apt-get install curl -y --force-yes
curl -skS https://raw.github.com/opscode/omnibus/master/source/install.sh | bash
mkdir -p /etc/chef
cat <<EOF >/etc/chef/client.rb
chef_server_url "$CHEF_SERVER"
chef_environment "$CHEF_ENVIRONMENT"
EOF
if [ -n "${VALIDATION_NAME}" ]; then
    echo "validation_client_name '$VALIDATION_NAME'" >> /etc/chef/client.rb
fi

cat <<EOF > /etc/chef/validation.pem
$CHEF_VALIDATOR
EOF
cp /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/distro/debian/etc/default/chef-client /etc/default/chef-client
cp /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/distro/debian/etc/init.d/chef-client /etc/init.d/chef-client
mkdir -p /var/log/chef
/etc/init.d/chef-client start<commit_msg>will broke my crap<commit_after>#!/bin/bash

REQUIRED="CHEF_SERVER CHEF_VALIDATOR"
for r in $REQUIRED; do
    if [[ -z ${!r} ]]; then
        echo Environment variable $r required but not set 1>&2
        exit 22
    fi
done

CHEF_ENVIRONMENT=${CHEF_ENVIRONMENT:-_default}
DEBIAN_FRONTEND=noninteractive apt-get install curl -y --force-yes
curl -skS https://raw.github.com/opscode/omnibus/master/source/install.sh | bash
mkdir -p /etc/chef
cat <<EOF >/etc/chef/client.rb
chef_server_url "$CHEF_SERVER"
chef_environment "$CHEF_ENVIRONMENT"
EOF
if [ -n "${CHEF_VALIDATION_NAME}" ]; then
    echo "validation_client_name '$CHEF_VALIDATION_NAME'" >> /etc/chef/client.rb
fi

cat <<EOF > /etc/chef/validation.pem
$CHEF_VALIDATOR
EOF
cp /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/distro/debian/etc/default/chef-client /etc/default/chef-client
cp /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/distro/debian/etc/init.d/chef-client /etc/init.d/chef-client
mkdir -p /var/log/chef
/etc/init.d/chef-client start
{'fraction_non_alphanumeric': 0.15066469719350073, 'fraction_numerical': 0.019694731659281144, 'mean_word_length': 3.9320388349514563, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3215081', 'n_tokens_mistral': 878, 'n_tokens_neox': 817, 'n_words': 146}