#!/usr/bin/env bash
ssh-add ~/.ssh/findaplayer.pem
remote_user="ec2-user"
hop_user="ubuntu"
hop_host="hop"
if [ "$1" == "ssh" ]; then
ssh -A -t -l $hop_user $hop_host \
ssh -A -t -l $remote_user $2
exit 0
fi
if [ "$1" == "tunnel" ]; then
ssh -A -t -l $hop_user $hop_host \
-L $3:localhost:$3 \
ssh -A -t -l $remote_user $2 \
-L $3:localhost:$3
exit 0
fi