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

export ECHON FUNCS PAGER TMPDIR TR

QUESTION="Enable the SNMP network management protocol"

showhelp true "
${QUESTION}?

A PrintServer printer is capable of supporting the standard
SNMP network management protocol.  This is an optional feature
of the printer that must be enabled when the printer is loaded.

For more information about SNMP, please refer to the
Management Guide.
"

# Convert "on/off" to "y/n"

if [ "$DEFVAL" ]   # Non-null default value?
then
    if boolval "$DEFVAL"
    then
	DEFVAL=Yes
    else
	DEFVAL=No
    fi
else
    DEFVAL=Yes     # Default for this variable
fi

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

exit 0
