Created
November 2, 2012 00:46
-
-
Save grahamc/3997896 to your computer and use it in GitHub Desktop.
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 | |
knife search node "*:*" -a ec2.public_ipv4 | awk -f knife-output.awk |
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
$1 ~ /^ec2/ { ip = $2; } | |
$1 == "id:" { names[$2] = ip; } | |
END { | |
for (name in names) { | |
if (names[name] != "") { | |
print "Host " name | |
print "Hostname " names[name] | |
print "ForwardAgent yes" | |
print "" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment