#! /bin/sh
#
# @(#)gettraylist	1.3	LPS_UNX_COM	2/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# gettraylist
#
# A script that prints the valid values for input and output trays
# by PrintServer type.
#
# Parameters:
#    $1 - Input or Output Tray (input or output)
#    $2 - PrintServer Model (LPS40, LPS20, LPS32, LPS17)
#
# Exit Values:
#    0 - Success; valid traytype and PrintServer model
#    1 - Failure; invalid traytype or PrintServer model
###

TRAYTYPE=$1
PSMODEL=$2

case $TRAYTYPE in
     input ) input=true  ;;
    output ) input=false ;;
         * ) echo "FAILURE: Unknown tray type \"$TRAYTYPE\"" 1>&2
	     exit 1 ;;
esac

case $PSMODEL in 
    LPS17 ) if $input
	    then
		LIST="top bottom"
	    else
		LIST="upper side"
	    fi
	    ;;
    LPS20 ) if $input
	    then
		LIST="top middle bottom"
	    else
		LIST="upper lower side"
	    fi
	    ;;
    LPS32 ) if $input
	    then
		LIST="top middle bottom"
	    else
		LIST="upper lower side"
	    fi
	    ;;
    LPS40 ) if $input
	    then
		LIST="top middle bottom"
	    else
		LIST="upper side face-up"
	    fi
	    ;;
	* ) echo "FAILURE: Invalid PrintServer model \"$PSMODEL\"" 1>&2
	    exit 1 ;;
esac

echo "$LIST default"   # Always add "default" as a valid tray name!

exit 0
