HSI Wrapper Script

This is an example HSI wrapper script that is used at Gleicher Enterprises.


#!/bin/bash

#

# *********************************************************************

#        WARNING    WARNING    WARNING

# This script must NOT write to stdout as it could potentially corrupt

# data if hsi is used in a pipeline!!! Any messages printed or echoed

# should do something like the following to write to stderr:

#     echo "some message" 1>&2

# ********************************************************************

#

# Michael  Gleicher

#

# Wrapper script for the HPSS Interface (HSI) Utility

#

#set -v -x


# If a restricted port range is to be used for the local

# machine, set the environment variable here, and tell the user

#echo "[RESTRICTED PORT RANGE IN EFFECT: 3000-3030]" 1>&2

#export HPSS_PFTPC_PORT_RANGE=ncacn_ip_tcp[3000-3030]


# At GEL, the HSI wrapper script and executable lives in

# /usr/local/apps/hsi/bin. 


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

# Default executable is a symbolic link called "hsi.exe",

# which links to the current version,for example, 

#       hsi.exe -> hsi.3.4.2.exe

HSI_BASE_PATH=/usr/local/apps/hsi

export HSI_EXE="$HSI_BASE_PATH/bin/hsi.exe"


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

# Location of hpss-specific config files, such as the HPSS.conf

# file.  Note that the HSIRC path is currently a compile-time option.

export HPSS_CFG_FILE_PATH="$HSI_BASE_PATH/etc"


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

# Set the location for the KERBEROS configuration file and version

# of kinit that is used to communicate with SDSC's HPSS.

# This is only needed if the system version is not correct, and the

# user does not have permissions to change it.

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


#export KRB5_CONFIG=$HSI_BASE_PATH/config/krb5.conf

#export KRB_KINIT=$HSI_BASE_PATH/bin/kinit


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

# Set the default port for the HSIGWD server

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

if [ "$HPSS_SERVER_PORT" = "" ]; then

# Set the port to 1217 for hsi version 3.4.2

   export HPSS_SERVER_PORT=1217

fi


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

# Set the default HSIGWD server hostname to connect to

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

if [ "$HPSS_SERVER_HOST" = "" ]; then

   export HPSS_SERVER_HOST=hpssgw.mgleicher.us/$HPSS_SERVER_PORT

fi


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

# Set the default network interface that should be used for inbound

# connections from the HPSS movers.  Note that this can be overridden

# in the "PFTP Client Interfaces" section of the HPSS.conf file.

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


if [ "$HPSS_HOSTNAME" = "" ]; then

   export HPSS_HOSTNAME=`hostname`

fi


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

# Make sure script does not expand wild cards meant for hsi.

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

set -o noglob


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

#  Fire up the program.  

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

$HSI_EXE "$@"

exit_status=$?


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

# If you want to warn the user if an error occurred, uncomment the

# following lines

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


#if [ "$exit_status" ] ; then

#    if [ $exit_status -ne 0 ] ; then

#        echo "###WARNING  hsi returned non-zero exit status." 1>&2

#        echo "            $exit_status = $HSI_EXE $@" 1>&2

#    fi

#    exit $exit_status

#else

#    exit 0

#fi

exit $exit_status