Skip to content

Instantly share code, notes, and snippets.

@dedmons
Created January 17, 2013 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dedmons/4556129 to your computer and use it in GitHub Desktop.
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…
# 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