#!/bin/sh                                                            

# Source OSG firewall information
if [ -e /var/lib/osg/globus-firewall ]; then
        . /var/lib/osg/globus-firewall
fi

#Uncomment and modify to override default osg firewall behavior
#export GLOBUS_TCP_PORT_RANGE=min,max
#export GLOBUS_TCP_SOURCE_RANGE=min,max

#############################################
# Source all files in /etc/sysconfig/gridftp.conf.d
#############################################
dir_cmd="ls -1 /etc/sysconfig/gridftp.conf.d";
# Exclude files left behind by rpm, vi, emacs, etc
file_exp="^((\..*)|(.*~)|(#.*)|(.*\.rpmsave)|(.*\.rpmnew))$"
if [ -d /etc/sysconfig/gridftp.conf.d ]; then
        for file in `$dir_cmd | egrep -v "$file_exp" 2>/dev/null` ; do
                . /etc/sysconfig/gridftp.conf.d/$file
        done
fi


export CLASSPATH=$CLASSPATH
                                                                      
exec /usr/sbin/globus-gridftp-server -c @sysconfdir_resolved@/gridftp-hdfs/gridftp-debug.conf -dsi hdfs -no-fork

