Skip to content

Instantly share code, notes, and snippets.

@johnhamelink
Created November 17, 2015 11:38
Show Gist options
  • Select an option

  • Save johnhamelink/34610b37b1fe9c9ccabe to your computer and use it in GitHub Desktop.

Select an option

Save johnhamelink/34610b37b1fe9c9ccabe to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
ssh-add ~/.ssh/findaplayer.pem
if [ "$1" == "ssh" ]; then
ssh -A -t -l ubuntu hop \
ssh -A -t -l ubuntu $2
exit 0
fi
if [ "$1" == "tunnel" ]; then
ssh -A -t -l ubuntu hop \
-L $3:localhost:$3 \
ssh -A -t -l ubuntu $2 \
-L $3:localhost:$3
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment