<commit_before>#!/bin/bash
#
# Boostraps an ubuntu machine to be used as an agent for nanobox

# exit if any any command fails; be verbose
set -ex

set -o pipefail

# todo:
# set timezone
# verify
# systemd compatibility

# set globals to defaults for testing
TOKEN="<PASSWORD>"
VIP="192.168.0.55"
ID="123"
COMPONENT=""

ubuntu_version() {
  lsb_release -sd \
    | awk '{print $2}' \
      | awk -F. '{print $1"."$2}'
}

init_system() {
  if [[ -f /sbin/systemctl ]]; then
    echo "systemd"
  elif [[ -f /sbin/initctl ]]; then
    echo "upstart"
  else
    echo "sysvinit"
  fi
}

internal_ip() {
  ip addr \
    | grep "$(internal_iface)" \
      | grep "inet 10\." \
        | awk '{print $2}' \
          | awk -F/ '{print $1}'
}

internal_iface() {
  echo "eth1"
}

fix_ps1() {
  sed -i 's|@\\h|@\\H|g' /root/.bashrc
}

install_docker() {
  # install docker if not already installed
  if [[ ! -f /usr/bin/docker ]]; then
    # add docker's gpg key
    apt-key adv \
      --keyserver hkp://p80.pool.sks-keyservers.net:80 \
      --recv-keys <KEY>

    # ensure lsb-release is installed
    apt-get -y install lsb-release

    release=$(lsb_release -c | awk '{print $2}')

    # add the source to our apt sources
    echo \
      "deb https://apt.dockerproject.org/repo ubuntu-${release} main" \
        > /etc/apt/sources.list.d/docker.list

    # update the package index
    apt-get -y update

    # ensure the old repo is purged
    apt-get -y purge lxc-docker

    # set docker defaults
    echo "$(docker_defaults)" > /etc/default/docker

    # install docker
    apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install docker-engine=1.12.0-0~${release}
  fi
}

start_docker() {
  if [[ ! `service docker status | grep start/running` ]]; then<commit_msg>Update docker version<commit_after>#!/bin/bash
#
# Boostraps an ubuntu machine to be used as an agent for nanobox

# exit if any any command fails; be verbose
set -ex

set -o pipefail

# todo:
# set timezone
# verify
# systemd compatibility

# set globals to defaults for testing
TOKEN="<PASSWORD>"
VIP="192.168.0.55"
ID="123"
COMPONENT=""

ubuntu_version() {
  lsb_release -sd \
    | awk '{print $2}' \
      | awk -F. '{print $1"."$2}'
}

init_system() {
  if [[ -f /sbin/systemctl ]]; then
    echo "systemd"
  elif [[ -f /sbin/initctl ]]; then
    echo "upstart"
  else
    echo "sysvinit"
  fi
}

internal_ip() {
  ip addr \
    | grep "$(internal_iface)" \
      | grep "inet 10\." \
        | awk '{print $2}' \
          | awk -F/ '{print $1}'
}

internal_iface() {
  echo "eth1"
}

fix_ps1() {
  sed -i 's|@\\h|@\\H|g' /root/.bashrc
}

install_docker() {
  # install docker if not already installed
  if [[ ! -f /usr/bin/docker ]]; then
    # add docker's gpg key
    apt-key adv \
      --keyserver hkp://p80.pool.sks-keyservers.net:80 \
      --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

    # ensure lsb-release is installed
    apt-get -y install lsb-release

    release=$(lsb_release -c | awk '{print $2}')

    # add the source to our apt sources
    echo \
      "deb https://apt.dockerproject.org/repo ubuntu-${release} main" \
        > /etc/apt/sources.list.d/docker.list

    # update the package index
    apt-get -y update

    # ensure the old repo is purged
    apt-get -y purge lxc-docker

    # set docker defaults
    echo "$(docker_defaults)" > /etc/default/docker

    # install docker
    apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install docker-engine=1.12.6-0~ubuntu-${release}
  fi
}

start_docker() {
  if [[ ! `service docker status | grep start/running` ]]; then
{'fraction_non_alphanumeric': 0.15462506841817186, 'fraction_numerical': 0.025177887246852763, 'mean_word_length': 2.5485436893203883, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2420806', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1318, 'n_words': 363}