Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joaoluiznaufel/b10c662976c02f67826c56a6efd85554 to your computer and use it in GitHub Desktop.
Save joaoluiznaufel/b10c662976c02f67826c56a6efd85554 to your computer and use it in GitHub Desktop.
Shell Script
#!/bin/bash
case "$1" in
"server1") echo "Connecting to server1"
sshpass -p 'your_passwd' ssh <user>@<ip_server>
echo "Connection closed with $1"
;;
"server2") echo "Connecting to server2"
sshpass -p 'your_passwd' ssh <user>@<ip_server>
echo "Connection closed with $1"
;;
*) echo "Server $1 is not available"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment