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

case $DEFVAL in
        [Oo][Nn] ) DEFVAL=y ;;
    [Oo][Ff][Ff] ) DEFVAL=n ;;
	       * ) DEFVAL=x ;;
esac

QUESTION="Enable Event Logging Services"

showhelp true "
${QUESTION}?

When event logging is enabled, the PrintServer will send event 
and error messages to each management client that is set up to
receive them.  If you do not enable event logging, these messages
will not be sent.

Event logging is an important tool to help diagnose problems with
your printer, should they arise.  It is strongly recommended that 
you enable event logging.
"

if yesno $DEFVAL "$QUESTION"
then
    echo "on" > $OUTFILE
else
    echo "off" > $OUTFILE
fi

exit 0
