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

showhelp true "
In what directory do network boot files reside?

All PrintServer printers are booted in two phases.  The first boot
phase, called the \"primary\" boot phase, is performed using two
special network daemon processes (\"bootpd\" and \"tftpd\") that
identify and transfer the primary system image (the VAXELN operating
system) to the printer.

The protocols, techniques and processes used to perform the primary boot
phase are not specific to the $PRODUCT kit.
This type of booting mechanism is standardized in the internet
(TCP/IP) environment using the \"bootpd\" and \"tftpd\" daemons.

When a PrintServer printer is first powered up, it sends out BOOTP
requests which are intercepted and processed by a bootpd daemon.  The
bootpd daemon determines the path of the printer's system image file
and sends that path to the printer.  The printer, in turn, contacts
the tftpd daemon on the same host as the bootpd daemon to physically
transfer the file.

For security reasons almost all tftpd daemons are executed such that
all requests for file transfers must reference files in a known,
controlled system directory.  This question refers to this special
system directory, and the default response represents the path of the
directory most frequently used.

In general, if you have never heard of the tftpd daemon (or any of
this network booting stuff, for that matter), it is probably best for
you to choose the default response.  If you do not intend to boot a
PrintServer printer on this system, then you should still choose the
default response.  If you are certain that a different directory
should be specified, then by all means enter that directory path.

Often a directory used for this purpose already exists on your system,
and the default response represents the path most commonly used
systems.  If the specified directory does currently exist, you will be
asked to confirm the specified path; this is done to guard against
mistakes made while entering the path."

getpath d "$DEFVAL" "Network boot files directory"

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

echo "$RESPONSE" > $OUTFILE

exit 0
