Created
September 6, 2018 07:44
-
-
Save joaoluiznaufel/b10c662976c02f67826c56a6efd85554 to your computer and use it in GitHub Desktop.
Shell Script
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
#!/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