Skip to content

Instantly share code, notes, and snippets.

@hilios
Created June 12, 2012 14:43
Show Gist options
  • Save hilios/2917941 to your computer and use it in GitHub Desktop.
Save hilios/2917941 to your computer and use it in GitHub Desktop.
Connect to zone
#!/bin/bash
USER="username"
HOST=$1
BRIDGE=FALSE
while getopts "u:h:b": OPT; do
# echo "$OPT=$OPTARG"
case ${OPT} in
u) USER=${OPTARG};;
b) BRIDGE=TRUE;;
h) HOST=${OPTARG};;
?) echo "Invalid parameter." >&2; exit -2 ;;
esac
done
echo "Connecting to: ${USER}@zone${HOST}.host.com"
if [ BRIDGE ]; then
ssh -t ${USER}@bridge.host.com "ssh priv${HOST}"
else
ssh ${USER}@zone${HOST}.host.com
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment