#! /bin/sh
#
# @(#)setTOPQDIR	1.2	LPS_UNX_COM	2/19/95
#
# Copyright 1995   Digital Equipment Corporation, Maynard, MA
#
# setTOPQDIR
#
# A script that produces a value for attribute TOPQDIR.
#
# 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
#    $6 - Path of the output file to receive the final attribute value
#
# Global variables:
#    ECHON
#    FUNCS
#    PAGER
#    TMPDIR
#
# 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

. $FUNCS   # Import the standard LPS shell functions

showhelp true "
In what directory do printer spool directories reside?

A printer spool directory is a directory in which files will be stored
while they are awaiting their turn to print on a specific printer.
Most sites use a directory such as \"/var/spool\" or \"/var/spool/printers\"
as the top-level directory for printer spool directories.

Note that older versions of BSD UNIX use the \"/usr\" root directory
instead of the \"/var\" directory; newer systems often have certain
directories in \"/usr\" symbolically linked to directories of the same
name in the \"/var\" directory.  If your system does indeed have a
\"/var\" directory, then use that directory path as the response
instead of the \"/usr\" directory path.

It is good idea to have this top-level directory exist on a filesystem
separate and apart from other system and user directories to keep the
spooling system from potentially filling up its filesystem with
spooled print files.

Normally a directory used for this purpose already exists on your
system, and the default response represents the path most commonly
used on $OSNAME systems.  If the specified directory does currently
exist, you will be asked to confirm the specified path; this is done
to guard against mistakes made while entering the path."

getpath d "$DEFVAL" "Top-level spool directory"

if [ -z "$RESPONSE" ]
then
    RESPONSE="$DEFVAL"
fi

echo "$RESPONSE" > $OUTFILE

exit 0
