Created
September 26, 2016 11:43
-
-
Save arkadius/a2ca676441152e3d219984f6c6904a18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
host=$1 | |
password=`awk "/#Password/ && inhost { print \\\$2 } /Host/ { inhost=0 } /Host $host/ { inhost=1 }" ~/.ssh/config` | |
if [[ -z "$password" ]]; then | |
/usr/bin/ssh $* | |
else | |
sshpass -p $password /usr/bin/ssh $* | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment