#! /bin/sh
#
# @(#)setACCOUNTING	1.3	LPS_UNX_COM	2/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# setACCOUNTING
#
# A script that produces a value for the printer configuration file
# keyword "accounting".
#
# 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
#    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

. $FUNCS   # Import the standard LPS shell functions

case $DEFVAL in
        [Oo][Nn] ) DEFVAL=On       ;;
    [Oo][Ff][Ff] ) DEFVAL=Off      ;;
    [Rr][Ee]*    ) DEFVAL=Reliable ;;
	       * ) DEFVAL=On       ;;
esac

QUESTION="What type of Accounting Services"

showhelp true "
${QUESTION}?

When accounting services are enabled, the printer supplies accounting
information to every management client that is set up to receive it.  If 
you do not enable accounting, the printer will not send accounting 
information to management clients.  

Reliable accounting provides secure and complete accounting 
information from the printer.  However, the printer will print jobs 
only when a management client is available to accept accounting data 
from the printer.  This feature can cause printing delays.
"

list="On Off Reliable"

choose $DEFVAL "$QUESTION" $list

case $RESPONSE in
          On ) RESPONSE=on       ;;
         Off ) RESPONSE=off      ;;
    Reliable ) RESPONSE=reliable ;;
	   * ) RESPONSE=on       ;;
esac

echo "$RESPONSE" > $OUTFILE

exit 0
