Guest User

Untitled

a guest
Jan 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. . ~/.bashrc
  4.  
  5. hosts=$(cd ~/system; knifepr node list|grep -E "dmz.s|int.s" | cut -f2 -d'"')
  6.  
  7. grp_file=~/.dsh/group/ams.new
  8. touch $grp_file
  9.  
  10. for host in $hosts; do
  11. ssh -o ConnectTimeout=1 $host true > /dev/null 2>&1
  12. if [ $? -eq 0 ]; then
  13. echo $host >> $grp_file
  14. fi
  15. done
Add Comment
Please, Sign In to add comment