Created
January 17, 2013 14:06
-
-
Save dedmons/4556129 to your computer and use it in GitHub Desktop.
This is a collection of functions to make connecting to Clemson's School of Computing lab machines easier. To use, add the functions into your shell rc file or login file, or source the file containing the functions. Then type the name of the function followed by the machine number and if you are off campus type remote also, e.x. dragon 5 will c…
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
# Created by Douglas "DJ" Edmonson | |
function dragon() { | |
min=1 | |
max=24 | |
if [[ $1 -lt $min || $1 -gt $max ]] | |
then | |
echo "Machine Number "$1" is not correct" | |
echo "There are only "$0$min" through "$0$max | |
return | |
fi | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0$1".cs.clemson.edu" | |
if [[ "$2" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0$1 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} | |
function frog() { | |
min=1 | |
max=22 | |
if [[ $1 -lt $min || $1 -gt $max ]] | |
then | |
echo "Machine Number "$1" is not correct" | |
echo "There are only "$0$min" through "$0$max | |
return | |
fi | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0$1".cs.clemson.edu" | |
if [[ "$2" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0$1 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} | |
function hornet() { | |
min=1 | |
max=27 | |
if [[ $1 -lt $min || $1 -gt $max ]] | |
then | |
echo "Machine Number "$1" is not correct" | |
echo "There are only "$0$min" through "$0$max | |
return | |
fi | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0$1".cs.clemson.edu" | |
if [[ "$2" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0$1 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} | |
function glare() { | |
min=1 | |
max=2 | |
if [[ $1 -lt $min || $1 -gt $max ]] | |
then | |
echo "Machine Number "$1" is not correct" | |
echo "There are only "$0$min" through "$0$max | |
return | |
fi | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0$1".cs.clemson.edu" | |
if [[ "$2" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0$1 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} | |
function newton() { | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0".cs.clemson.edu" | |
if [[ "$1" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} | |
function sparc() { | |
min=1 | |
max=2 | |
if [[ $1 -lt $min || $1 -gt $max ]] | |
then | |
echo "Machine Number "$1" is not correct" | |
echo "There are only "$0$min" through "$0$max | |
return | |
fi | |
uname= | |
echo -n "Username: " | |
read uname | |
accs_addr=$uname"@access.cs.clemson.edu" | |
host_addr=$uname"@"$0$1".cs.clemson.edu" | |
if [[ "$2" == "remote" ]] | |
then | |
echo "Connecting via access.cs.clemson.edu" | |
ssh -t $accs_addr "ssh $host_addr" | |
else | |
echo "Directly connecting to "$0$1 | |
ssh $host_addr | |
fi | |
echo "Done" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment