#! /bin/bash

### script to generate ssh-reachable nodes, /share/tmp/ssh-nodes.dat

/share/bin/pdsh_sshreachable > /dev/null
hosts=$(cat  /share/tmp/ssh-reachable.dat)
rm -rf  /share/tmp/ssh-nodes.dat
for i in $hosts
	do
		if [ ! "$i" = 'master' ] && [ ! "$i" = 'localhost' ]
		then	
			echo $i >> /share/tmp/ssh-nodes.dat
		fi
	done
echo 'ssh-reachable nodes (excluding master and localhost) are' $(cat /share/tmp/ssh-nodes.dat)


