#!/bin/ksh
#
# ident "@(#)bbupload.sh 1.2     01/05/30 SMI"
#
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#                       
# 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
