#! /bin/sh
# Copyright 1995, 1999 by Paul Mattes.
#  Permission to use, copy, modify, and distribute this software and its
#  documentation for any purpose and without fee is hereby granted,
#  provided that the above copyright notice appear in all copies and that
#  both that copyright notice and this permission notice appear in
#  supporting documentation.
#
# Run x3270 from the current directory

# Bomb on any error
set -e
d=`pwd`/

# Say what you're doing
set -x

# Set up the fonts
mkfontdir .
xset +fp $d
xset fp rehash

# Set up the dynamic library path
if [ -d /usr/openwin/lib ]
then  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/openwin/lib
fi
if [ -d /usr/ucblib ]
then  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/ucblib
fi
export LD_LIBRARY_PATH

# Run x3270
set +e
./x3270 "$@"

# Clean up
xset -fp $d
xset fp rehash
