#!/bin/ksh -p
#
# ident "@(#)bbupload.src	1.4 05/02/17 SMI"
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

# translates the unix user to the corona token
# and uploads the user data to the portal
# $1 - unix user
# $2 - config file to use

. $BBROOT/etc/opt/SUNWbb/blackbox.rc
. $BBPATH/bin/bbupdnfunc              

RES=0

TOKEN=`cat $BBLOCKPATH/$1.lock 2>/dev/null`

if [ ${#TOKEN} != 0 ]; then
	echo "BB upload for user: $1, token: $TOKEN"
	read_file up $2 $TOKEN
else
	echo "failed to get user token"
	RES=1
fi

exit $RES
