#! /bin/sh
#
# @(#)setMODEL	1.8	LPS_UNX_COM	3/22/95
#
# Copyright 1995   Digital Equipment Corporation, Maynard, MA
#
# setMODEL
#
# A script that produces a value for attribute MODEL.  Currently this
# script is only designed for the PS class.
#
# Parameters:
#    $1 - LPS class identifier, one of {PC, MC, PS, ENV}
#    $2 - Operating system type identifier (eg: SV2, BSD, etc)
#    $3 - Print client type identifier (eg: AIX, BSD, SV3, etc)
#    $4 - PrintServer printer model (eg: LPS17, LPS20)
#    $5 - Default value for the attribute (IGNORED)
#    $6 - Path of the output file to receive the final attribute value
#
# Global variables:
#    ECHON
#    FUNCS
#    PAGER
#    TR    (for the checknumrange() function)
#
# Exit values:
#    0 - Success, output file contains newly set attribute value.
#    1 - Error or interruption occurred, error messages go to stderr,
#	 contents of the output file are undefined.
###

CLASS=$1
OSTYPE=$2
PCTYPE=$3
PSMODEL=$4
DEFVAL=$5
OUTFILE=$6

MODELLIST="\
PrintServer17-family \
PrintServer20-family \
PrintServer32-family \
PrintServer40-family \
"

. $FUNCS   # Import the standard LPS shell functions

case "$PSMODEL" in
    "LPS17" ) model="PrintServer17-family" ;;
    "LPS20" ) model="PrintServer20-family" ;;
    "LPS32" ) model="PrintServer32-family" ;;
    "LPS40" ) model="PrintServer40-family" ;;
	  * ) model="PrintServer17-family" ;;  # Arbitrary default model!
esac

choose $model "What model is this printer" $MODELLIST

case "$RESPONSE" in
    "PrintServer17-family" )  PSMODEL="LPS17"   ;;
    "PrintServer20-family" )  PSMODEL="LPS20"   ;;
    "PrintServer32-family" )  PSMODEL="LPS32"   ;;
    "PrintServer40-family" )  PSMODEL="LPS40"   ;;
			 * )  PSMODEL="unknown" ;;
esac

echo "$PSMODEL" > $OUTFILE

exit 0
