#! /bin/sh
#
# @(#)validPStray	1.3	LPS_UNX_COM	02/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# validPStray
#
# A script that checks the validity of a given input or output tray by
# PrintServer type.
#
# Parameters:
#    $1 - Input or Output Tray Type (input or output)
#    $2 - Tray Name (top, middle, bottom, etc.)
#    $3 - Print Server Object Name
#
# Global Variables:
#    LPSODB
#    LPSODBLIST
#
# Exit Values:
#    0 - Tray name is valid
#    1 - Tray name is invalid
#    2 - Failure occurred in the script
###

TRAYTYPE=$1
TRAYNAME=$2
PSNAME=$3

if MODEL="`$LPSODBLIST -f $LPSODB -s $PSNAME -v model`"
then
    if validtray $TRAYTYPE $TRAYNAME $MODEL
    then
	exit 0
    else
	exit 1
    fi
else
    exit 2
fi
