#! /bin/sh

if [ -d /usr/local/bcnu ]
then
	BCNUHOME="/usr/local/bcnu"
else
	echo "Enter directory name of bcnu home:[/usr/local/bcnu] \c"
	read home
	if [ -z "$home" ]
		then
			BCNUHOME="/usr/local/bcnu"
		else
			BCNUHOME=$home
	fi
fi
cd $BCNUHOME

. $BCNUHOME/etc/bcnuenv

echo "Please wait.."
BCNULOADED=`$BCNUHOME/scripts/get_hosts managed`

for client in $BCNULOADED
do
	$BCNUHOME/bin/bcnu -s $BCNUPORT -p $client | head -1 |cut -f1 -d,
done
