#    Copyright (c) 1996-2001 Brocade Communications Systems, Inc.
#    All rights reserved.
#
#    profile for the admin user of Fabric OS services and interfaces
#

if [ $setup_standby_profile -eq 0 ]; then
#changed the path to point to abin
PATH="/fabos/link_abin:/fabos/link_sbin:/fabos/link_bin"
# Set the control-C handler back to default
# This trap was turned off in /etc/profile.
# Note that this trap statement should be BEFORE chkdefaultpasswds
# otherwise control-C cannot be used to quit changing default passwords.
trap - INT
#
# Defect 22765: Login during CP becoming active could hit a timing
# window that the active PATH hasn't been setup, use full path
#
#Adding check to avoid default passwd check for dedicated account
#login in Kestrel3
swbd=`/sbin/sin | /bin/awk ' {print $2} ' | /fabos/bin/grep SWBD | /bin/sed 's@,@@'`
if [ $swbd == "SWBD149" ]; then
	if [ x$SSO != "x1" ]; then
		/fabos/bin/chkdefaultpasswds
	fi
else
if [ $LOGIN_ID == "admin" ]; then
	# check default password only for local switch acct
	if [[ $AUTH_TYPE -eq 0 ]]; then	
		/fabos/bin/chkdefaultpasswds
		ret=$?
		if [ $ret -eq 2 ]; then
			exit 2
		fi
	fi
fi
/fabos/bin/passwdhashchange
stat=$?
if [ $stat -eq 1 ]; then
	exit 1
fi
fi
else
PATH="/fabos/link_abin:/fabos/link_sbin:/fabos/link_bin"
# Set trap for SIGINT back to default. See comments above.
trap - INT
fi
# we will disable hashing as it will defeat our PATH settings
# by hashing the original symbolic link values to the
# obsolute paths.
shopt -s checkhash > /dev/null
