BlueRey

getnodes.sh

Jun 1st, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.20 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. nodes=("controller01" "compute01" "compute02" "storage01" "storage02" "storage03")
  4.  
  5. for n in "${nodes[@]}"
  6. do
  7.     host $n | grep -v alias | awk -v node=$n '{ print $4, $1, node }'
  8. done
Add Comment
Please, Sign In to add comment