#! /bin/bash


# default libexecdir used to bootstrap scripts
libexecdir=${GLOBUS_LOCATION}/libexec

# load GRIS common code and initialization
. ${libexecdir}/grid-hostinfo-common

######################################################################

#_fs_count=0
_fs_total_size_mbytes=0
_fs_total_free_mbytes=0
# _fs_N_mount="mount location"
# _fs_N_size_mbytes="number"
# _fs_N_free_mbytes="number"

if [ ${_fs_count} -eq 0 ]
then
    _fs_type=default
else
    _fs_type=scratch
fi

emit_resource_fs_devices ()
{
#echo "<FileSystems>"
    i=0
    while [ $i -lt ${_fs_count} ]
    do
	eval "mount=\${_fs_${i}_mount}"
	eval "size=\${_fs_${i}_size_mbytes}"
	eval "free=\${_fs_${i}_free_mbytes}"
	${GLOBUS_SH_CAT-cat} <<EOF
<ce:FileSystem
  ce:Name="${mount}"
  ce:Size="${size}"
  ce:AvailableSpace="${free}"
  ce:Root="${mount}"
  ce:Type="unavailable"
  ce:ReadOnly="false"
  xmlns:ce="http://glue.base.ogsa.globus.org/ce/1.1"
/>

EOF
	i=`$EXPR $i + 1`
    done
#echo "</FileSystems>"
}

emit_resource_fs_descriptions ()
{
    probe_mds_object_timestamps

    timestamps=`emit_mds_object_timestamps`

    emit_resource_fs_devices
}

