Sha256: 21431a85452eddc6333ba528dc8fac473a7d2815e6c10825e947863d226d18ed

Contents?: true

Size: 712 Bytes

Versions: 6

Compression:

Stored size: 712 Bytes

Contents

#!/bin/bash
function install_jq() {
  if ! type jq > /dev/null ; then
    wget "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
    mv jq-linux64 /usr/local/bin/jq
    chmod a+x /usr/local/bin/jq
  fi
}

function configure_aws_cli() {
  local home_dir
  home_dir=${1:-/root} # default to /root
  # Configure aws cli in case it is not yet configured
  mkdir -p "$home_dir/.aws"
  EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
  EC2_REGION=${EC2_AVAIL_ZONE::-1}
  cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
[default]
region = $EC2_REGION
output = json
CONFIGURE_AWS_CLI
}

function setup() {
  install_jq
  configure_aws_cli /root
}

setup

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
forger-3.0.2 lib/forger/scripts/auto_terminate/setup.sh
forger-3.0.1 lib/forger/scripts/auto_terminate/setup.sh
forger-3.0.0 lib/forger/scripts/auto_terminate/setup.sh
forger-2.0.5 lib/forger/scripts/auto_terminate/setup.sh
forger-2.0.4 lib/forger/scripts/auto_terminate/setup.sh
forger-2.0.3 lib/forger/scripts/auto_terminate/setup.sh