Skip to content

Instantly share code, notes, and snippets.

@dforocha
Last active April 5, 2017 13:44
Show Gist options
  • Save dforocha/b311872eb37b52ed432346ec22c789c7 to your computer and use it in GitHub Desktop.
Save dforocha/b311872eb37b52ed432346ec22c789c7 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
clean-jerico
clean-jis
clean-jps
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";;
clean-jerico)
ssh -i $PEM_KEY [email protected] "$2";;
clean-jis)
ssh -i $PEM_KEY [email protected] "$2";;
clean-jps)
ssh -i $PEM_KEY [email protected] "$2";;
clean-database)
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