#!/bin/bash -e
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# r57.hsc src/hsc/scripts/hmcbash.sh 1.2 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2005 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
trap "" 2 3 5 9 11 15
read parent < /proc/$PPID/status
pn=${parent##*[[:blank:]]}
if [[ "$pn" = "login" || "$pn" = "login.krb5" || "$pn" = "bash" || "$pn" = "su" || "$pn" = "xdm" || "$pn" == "xterm" || "$pn" == "sys.xsession" ]]; then
   trap 2 3 5 9 11 15
   export PATH=$PATH:/usr/hmcrbin:/hmcrbin
   exec /bin/bash $*
else
   f=$1
   . /etc/SuSEconfig/profile
   trap 2 3 5 9 11 15
   export PATH=/usr/hmcrbin:/hmcrbin
   if [ "$1" != "" ]; then
     shift
     exec /bin/bash --restricted --rcfile /opt/hsc/data/ssh/hmcsshrc $f "$*"
   else
     exec /bin/bash --restricted --rcfile /opt/hsc/data/ssh/hmcsshrc $*
   fi
fi
