Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -ex
  4.  
  5. export AWS_DEFAULT_REGION="ap-northeast-1"
  6.  
  7. SGID="sg-xxxxxxxx"
  8. MYIP="`dig +short myip.opendns.com @resolver1.opendns.com`"
  9.  
  10. cd $(dirname $(readlink -f $0))
  11.  
  12. trap "aws ec2 revoke-security-group-ingress --group-id ${SGID} --protocol tcp --port 22 --cidr ${MYIP}/32" 0 1 2 3 15
  13. aws ec2 authorize-security-group-ingress --group-id ${SGID} --protocol tcp --port 22 --cidr ${MYIP}/32
  14. cd ../deploy && ./deploy-to-staging.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement