#!/bin/ksh -p
#
# ident "@(#)tokenreader.start.sh	1.1 04/01/08 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
set -u

# The following magic comment inhibits starting an X server
## utdtsession no-xinit

UTVAR=/var/opt/SUNWut
UTOPT=$(/usr/bin/pkginfo -r SUNWuto)/SUNWut
UTLIB=${UTOPT}/lib
UTBIN=${UTOPT}/bin
UTSBIN=${UTOPT}/sbin
PATH=${UTSBIN}:${UTBIN}:${UTLIB}:/usr/bin:/usr/sbin

fulltoken=${1}
cd /tmp
function cleanup {
	${UTLIB}/utdtsession -t $fulltoken delete <<-!
	!
}

trap "cleanup" 0 1 2

cat $(print $UTVAR/tokens/$fulltoken | sed -e 's=\.=/=g') |
${UTLIB}/yuvfile -c null -i - -x 576 -y 448 -d 250 -n 120 ${UTLIB}/tokenreader.yuv
