Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- . ~/.bashrc
- hosts=$(cd ~/system; knifepr node list|grep -E "dmz.s|int.s" | cut -f2 -d'"')
- grp_file=~/.dsh/group/ams.new
- touch $grp_file
- for host in $hosts; do
- ssh -o ConnectTimeout=1 $host true > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- echo $host >> $grp_file
- fi
- done
Add Comment
Please, Sign In to add comment