Created
July 16, 2013 18:28
-
-
Save gkze/6011283 to your computer and use it in GitHub Desktop.
Stephen Frost's crazy one-liner
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 | |
for host in *; do NAME=`echo $host | cut -f1 -d.`; DOMAIN=`echo $host | cut -f2 -d.`; IPMI="$NAME.ipmi.$DOMAIN.resonatedigital.net"; IP=`host $IPMI | cut -f4 -d' '`; if [ "$IP" != "found:" ]; then cat TEMPLATE.cfg | sed -e "s:NAME:$NAME.ipmi.$DOMAIN:" -e "s:IPADDRESS:$IP:" -e 's:rsnt_iad_linux_physical_hadoop:rsnt_iad_oob_ipmi:' -e 's:generic-rsnt-iad-linux-host:generic-rsnt-iad-host:' | grep -v 'register' > ../../../oob/ipmi/$NAME.ipmi.$DOMAIN.cfg; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment