
trap 'exit' 1 2 3 15
#	ATT: ident	"sadmin:admin/profile.dot	2.4"

#ident	"@(#)sadmin/admin:profile.dot	25.1"

#	The .profile file for the unixadmin set of utilities.

set -f
MENUTOP=`pwd`
PATH=/bin:/usr/bin:/usr/lbin
export PATH MENUTOP
if [ ! -x ${LOGNAME:?} ]
then
	admerr ${LOGNAME} Program ${LOGNAME} not installed or not executable.
	exit
fi

if [ "${SHELL}" = /bin/rsh ]
then
	# Invoked by login.  L0 through L5 are arguments from login line.
	#	Permits shortcuts such as  "login:  sysadm adduser".
	SHELL=/bin/sh
	export SHELL
	exec ./${LOGNAME} ${L0} ${L1} ${L2} ${L3} ${L4} ${L5}
fi

# Check if out file descriptor 3 is a tty.  If not, it has been set up
# as a pipe from /usr/bin/sysadm.  The only other way to get here is to
# type 'su - COMMAND'.  In this case 3 WILL be a tty.

./istty 0<&3
if [ $? -eq 1 ]
then
#       Read the arg passed from /usr/bin/sysadm ( if any )
	read args 0<&3
	exec 3<&-
fi
exec ./${LOGNAME} ${args}
