#! /bin/sh
#
# @(#)setACCTUNIT	1.3	LPS_UNX_COM	02/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# setACCTUNIT
#
# A script that produces a value for attribute ACCTUNIT.
#
# 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
#    OSNAME
#    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.
###
# NOTE:  This script has dependencies on the following variables:
#		OSNAME
#
CLASS=$1
OSTYPE=$2
PCTYPE=$3
PSMODEL=$4
DEFVAL=$5
OUTFILE=$6

. $FUNCS   # Import the standard LPS shell functions

if [ "$CLASS" = "ENV" ]
then
   NOTES="
Note carefully that this choice is used only as a default response
when you later define a Print Client; you will be able to override
this default value each time you create a Print Client queue.

A typical site will choose the default response for this question."
fi

showhelp true "
What type of accounting should be kept for print requests?

Accounting information for print jobs can be generated on your system
on either a \"job\" or \"file\" basis.  $OSNAME systems typically use
\"file\" accounting, whereby a small accounting record is appended to
an accounting data file for each file printed in each print job.

You can reduce the number of accounting records (at the expense of
less detailed print job statistics) by choosing the \"job\" accounting
type.
$NOTES"

list="file job"

choose "$DEFVAL" "Print request accounting type" $list

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

echo "$RESPONSE" > $OUTFILE

exit 0
