:
#	%Z% %M% %I% %D% %Q%
#
#	Copyright (C) Microsoft Corporation, 1985
#
#	This Module contains Proprietary Information of Microsoft
#	Corporation and AT&T, and should be treated as Confidential.
#
#	Xenix V lp Spooler Initialization 
#	=================================
#	This script adds a new destination for the lp spooler.  Only
#	the super-user can use this script meaningfully.
#
#	The strings def* below define the default values.

defdev="/dev/lp"
defname="linepr"
defprog="/usr/spool/lp/model/dumb"

PATH=/etc:/bin

trap   'echo;							\
	echo "";						\
	echo "INTERRUPTED - type $0 to restart";		\
	exit 2'							\
1 2 3 15


echo
echo "The printer is attached to device:"
echo
ls /dev/lp*

echo "\nEnter one of the above printer ports"
echo "(default = $defdev)\t\t\t\t : \c"
read device junk
[ -z "$device" ] && device="$defdev"

echo "\nEnter a name for the printer"
echo "(default = $defname)\t\t\t : \c"
read name junk
[ -z "$name" ] && name="$defname"

echo "\nEnter an interface program"
echo "(default = $defprog)\t : \c"
read program junk
[ -z "$program" ] && program="$defprog"

echo
/usr/lib/lpshut

set -e
/usr/lib/lpadmin -p$name -v$device -i$program
/usr/lib/lpsched

set +e
/usr/lib/accept $name
/usr/lib/lpenable $name

if	echo "\nIs this the default printer ? [y|n]"
	echo "(default = y)\t\t\t\t : \c"
	read reply rest
	[ -z "$reply" -o "$reply" = "y"  -o "$reply" = "Y" ]
then
	/usr/lib/lpadmin -d$name
fi

exit 0
