Sha256: a89812551a0cc7bd84c38f24019a2c12c4077bc4bf621af508ec7e4c86ff6656

Contents?: true

Size: 772 Bytes

Versions: 24

Compression:

Stored size: 772 Bytes

Contents

#!/bin/bash -eux
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"
  if [ ! -f "$home_dir/.aws/config" ]; then
    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
  fi
}

function setup() {
  install_jq
  configure_aws_cli /root
}

setup

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
forger-2.0.0 lib/forger/scripts/auto_terminate/setup.sh
forger-1.6.0 lib/forger/scripts/auto_terminate/setup.sh
forger-1.5.4 lib/forger/scripts/auto_terminate/setup.sh
forger-1.5.3 lib/forger/scripts/auto_terminate/setup.sh
forger-1.5.2 lib/forger/scripts/auto_terminate/setup.sh
forger-1.5.1 lib/forger/scripts/auto_terminate/setup.sh
forger-1.5.0 lib/forger/scripts/auto_terminate/setup.sh
aws-ec2-1.4.9 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.8 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.7 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.6 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.5 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.4 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.3 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.2 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.1 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.4.0 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.3.2 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.3.1 lib/aws_ec2/scripts/auto_terminate/setup.sh
aws-ec2-1.3.0 lib/aws_ec2/scripts/auto_terminate/setup.sh