Skip to content

Instantly share code, notes, and snippets.

@sandrocarval
Forked from dforocha/goadt
Created December 21, 2016 16:27
Show Gist options
  • Save sandrocarval/6974001759e247ebd12ab36c883b316d to your computer and use it in GitHub Desktop.
Save sandrocarval/6974001759e247ebd12ab36c883b316d to your computer and use it in GitHub Desktop.
script to do the ssh on adtsys machines
#!/bin/bash
export PEM_KEY="~/.ssh/aws-totvs.pem"
function list() {
echo "ADTsys server list:
jerico01
jerico02
jis01
jis02
jps01
jps02
doomsday01
doomsday02
sensu01
sensu02
salt01
salt02
salt02b
salt-sust
salt-fenix
salt-peanuts
postgre01
postgre02
genesis
"
}
if [ "x$1" == "x" ]
then
list
echo "Digite um servidor: "
read server
else
server=$1
fi
case $server in
jerico01)
ssh -i $PEM_KEY [email protected] "$2";;
jerico02)
ssh -i $PEM_KEY [email protected] "$2";;
jps01)
ssh -i $PEM_KEY [email protected] "$2";;
jps02)
ssh -i $PEM_KEY [email protected] "$2";;
jis01)
ssh -i $PEM_KEY [email protected] "$2";;
jis02)
ssh -i $PEM_KEY [email protected] "$2";;
doomsday01)
ssh -i $PEM_KEY [email protected] "$2";;
doomsday02)
ssh -i $PEM_KEY [email protected] "$2";;
sensu01)
ssh -i $PEM_KEY [email protected] "$2";;
sensu02)
ssh -i $PEM_KEY [email protected] "$2";;
salt01)
ssh -i $PEM_KEY [email protected] "$2";;
salt02)
ssh -i $PEM_KEY [email protected] "$2";;
salt02b)
ssh -i $PEM_KEY [email protected] "$2";;
salt-sust)
ssh -i $PEM_KEY [email protected] "$2";;
salt-peanuts)
ssh -i $PEM_KEY [email protected] "$2";;
salt-fenix)
ssh -i $PEM_KEY [email protected] "$2";;
postgre01)
ssh -i $PEM_KEY [email protected] "$2";;
postgre02)
ssh -i $PEM_KEY [email protected] "$2";;
calc01)
ssh -i $PEM_KEY [email protected] "$2";;
genesis)
ssh -i $PEM_KEY [email protected] "$2";;
*)
echo server invalido ; list;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment