Created
October 11, 2014 02:34
-
-
Save gosuri/797d544e261ac37d681a to your computer and use it in GitHub Desktop.
node-ssh.sh
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 | |
# handy functions to ssh into box using chef node name | |
# example: node-ssh prod-dnscache-oregon | |
function node-ip { | |
cmd="`which ruby` -e 'print eval(\`knife node show $1 -a node.ipaddress -F pp\`)[\"node.ipaddress\"]'" | |
eval $cmd | |
} | |
function node-ssh { | |
cmd="ssh \`node-ip $1\`" | |
eval $cmd | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment