Skip to content

Instantly share code, notes, and snippets.

@tovbinm
Created November 2, 2012 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tovbinm/4003655 to your computer and use it in GitHub Desktop.
Save tovbinm/4003655 to your computer and use it in GitHub Desktop.
Install EC2 command line tools
#!/bin/bash
EC2_DIR=/usr/local/ec2
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip -O ec2-api-tools.zip
wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip -O ec2-ami-tools.zip
mkdir -p $EC2_DIR
rm -rf $EC2_DIR/*
unzip -o -d $EC2_DIR ec2-api-tools.zip
unzip -o -d $EC2_DIR ec2-ami-tools.zip
cp -r $EC2_DIR/ec2-api-tools*/* $EC2_DIR
cp -r $EC2_DIR/ec2-ami-tools*/* $EC2_DIR
rm -rf $EC2_DIR/ec2-api-tools* $EC2_DIR/ec2-ami-tools*
rm ec2-api-tools.zip ec2-ami-tools.zip
echo -e "\n===============================================================================\n" \
"\nEC2 command line tools were installed successfully." \
"\nDon't forget to set you environment variables:\n" \
"\nexport JAVA_HOME=<your Java home>" \
"\nexport EC2_HOME=$EC2_DIR" \
"\nexport EC2_PRIVATE_KEY=<path to your private key.pem>" \
"\nexport EC2_CERT=<path to your cert.pem>" \
"\nexport PATH=\$PATH:\$EC2_HOME/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment