#! /bin/sh
#
# @(#)setLPSACCT	1.2	LPS_UNX_COM	02/19/95
#
# Copyright 1995   Digital Equipment Corporation, Maynard, MA
#
# setLPSACCT
#
# A script that produces a value for attribute LPSACCT.
#
# 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

# Note: special intro text is generated based on certain key
#       kit variables.

if $SHKIT && $NEEDPCACCT	# Both SH and PC accounting available
then
	intro="
A Management Client can be configured to store centralized accounting
data received from its associated PrintServer printer.  Similarly, a
Print Client can be configured to store job accounting information in
a specified accounting file."
else
    if $SHKIT		# Only SH accounting available
    then
	intro="
A Management Client can be configured to store centralized accounting
data received from its associated PrintServer printer."
    else		# Only PC accounting available
	intro="
A Print Client can be configured to store job accounting information
in a specified accounting file."
    fi
fi

showhelp true "
In what directory should accounting files be written?
$intro
This question asks you for the default system directory into which
these accounting files will be placed by default.

It is a good idea for this directory to exist in a filesystem which
will not impact your system's operation should the filesystem fill up
with accounting information.

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 not
currently exist, you will be asked to confirm the specified path; this
is done to guard against mistakes made while entering the path.

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

getpath d "$DEFVAL" "Accounting files directory"

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

echo "$RESPONSE" > $OUTFILE

exit 0
