#! /bin/sh

# checking for the GLOBUS_LOCATION

if test "x$GLOBUS_LOCATION" = "x"; then
    echo "ERROR Please specify GLOBUS_LOCATION" >&2
    exit 1
fi

if [ ! -f ${GLOBUS_LOCATION}/libexec/globus-bootstrap.sh ]; then
    echo "ERROR: Unable to locate \${GLOBUS_LOCATION}/libexec/globus-bootstrap.sh"
    echo "       Please ensure that you have installed the globus-core package and"
    echo "       that GLOBUS_LOCATION is set to the proper directory"
    exit
fi


for script in *.xml; do
    perl_script=`echo $script | sed s/xml/pl/`
    np_perl_script=`echo $perl_script | sed -e s/^/non_persistent_/`
    sed s/@SCRIPT_NAME@/$script/ < xml_script_test.in > $perl_script
    sed s/@SCRIPT_NAME@/$script/ < xml_script_test_non_persistent.in \
            > $np_perl_script
done

. ${GLOBUS_LOCATION}/libexec/globus-bootstrap.sh
