#! /bin/sh
#ident	"@(#)appshare:Xterm	1.1"
#       Script Template for Shared X Applications
#       Need to have LD_LIBRARY_PATH exported
#       PATH also
#       $1 is the display name argument
REMAPPL="TEXT_APPLICATION"
export REMAPPL
CONSEM=no
export CONSEM
DISPLAY=$1
export DISPLAY
LD_LIBRARY_PATH=:/usr/X/lib:/usr/X/lib:/usr/X/lib
export LD_LIBRARY_PATH
PATH=$PATH:/sbin:/usr/sbin:/usr/bin:/etc::/usr/X/bin::/bin:/usr/X/lib:/usr/ucb:/usr/X
export PATH
TERM=xterm
export TERM
TERMCAP=/etc/termcap
export TERMCAP
TIMEZONES=`/usr/bin/grep TZ= /etc/TIMEZONE | /usr/bin/cut -d= -f2`
for ENTRY in $TIMEZONES
do
	TZ=$ENTRY
	export TZ
done
XWINHOME=/usr/X
export XWINHOME
LOGNAME=$USER
export LOGNAME

if test -r $HOME/.olsetup
then
   GUITYPE=`/usr/bin/grep XGUI= $HOME/.olsetup | /usr/bin/cut -d= -f2`
   XGUI=`echo $GUITYPE | /usr/bin/cut -d" " -f1`
   export XGUI
else
   XGUI=MOTIF
   export XGUI
fi

# Check to see if Root can log in remotely 
if test -r /etc/default/login 
then
    TEMPNAME=`id | /usr/bin/cut -d"(" -f2`
    TEMPNAME=`echo $TEMPNAME | /usr/bin/cut -d")" -f1`
    if test $TEMPNAME = root
    then
       TEMPCONS=`/usr/bin/sed -n '/CONSOLE/p' /etc/default/login | /usr/bin/sed -n '/^[ ,	]*#/p'`
       test -z "$TEMPCONS"
       case $? in
       0) 
           echo "Not at system console. Permission denied\n" | $XWINHOME/desktop/rft/dtmsg 
           exit 0;;    
       esac 
    fi
fi 





case $REMAPPL in
"X_APPLICATION") xterm  -display $1 -ls
;;
"TEXT_APPLICATION") xterm -display $1 -ls
;;
esac
