Created
June 12, 2012 14:43
-
-
Save hilios/2917941 to your computer and use it in GitHub Desktop.
Connect to zone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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