#!/usr/bin/ksh
tag=$3
count=0
cookie=`$CMSHOME/lib/u4ftctl find / $tag`
if [ `$CMSHOME/lib/u4ftctl get_state $cookie` = "failed" ]
then
	$CMSHOME/lib/u4ft_offlineParent $1 $2
fi
$CMSHOME/lib/cmsreport $1 $2 action online
while [ `$CMSHOME/lib/u4ftctl get_state $cookie` = "offline" ]
do
	count=`expr $count + 1 `
	if [ $count -eq 20 ]
	then
		exit
	fi
	sleep 2
done
