DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T u

⟦0af335e55⟧ TextFile

    Length: 2317 (0x90d)
    Types: TextFile
    Names: »usr/lbin/lpsetup1 «

Derivation

└─⟦833723c12⟧ Bits:30004042/core5.imd SW95705I 386/ix Multi-user Release 1.2
    └─⟦this⟧ »usr/lbin/lpsetup1 « 

TextFile

#ident  "%W% - %E%"
#
#		setup1 type interface [ filter ]
#
#	Setup a new printer of type "type" using interface
#	/usr/spool/lp/model/"interface". 
#	Hardwired tty lines are set up appropriately in /etc/inittab.
#
MODEL=/usr/spool/lp/model

case $2 in
RC607 | RC608)	mopt=rc609 ;;
RC640)			mopt=rc632 ;;
*)				mopt=$2 ;;
esac
if [ -s "$MODEL/${mopt}r" ]
then
	while :
	do
		echo "Do you want this printer to be a remote printer."
		echo "This requires that the remote default printer"
		echo "has the same type as this printer"
		echo "Enter hostname or return for local \c"
		read popt
		if [ "$popt" = "" ]
		then
			break
		fi
		if lpstat -p | grep "$popt" >/dev/null 2>&1
		then
			echo "\nThere is a remote printer for this host\007\n"
		else
			dev=/dev/lpnull
			mopt=${mopt}r
			break
		fi
	done
else
	popt=
fi
if [ "$popt" = "" ]
then
	# Choose printer name.
	X=`lpstat -p | grep "${2}_[1-9][0-9]*" | wc -l`
	X=`expr ${X} + 1`

	# Let installer override the default.
	echo "The printer name is ${2}_${X}.\n"
	echo "If ${2}_${X} is OK, hit RETURN or"
	echo "if you would prefer another name, enter the name:  \c"
	read popt
	popt=${popt:-"${2}_${X}"}

	while
		[ "${dev}" = "" ]
	do
		echo "\nThe choices for serial printer device name are:\n"
		ls -C /dev/tty[0-9][0-9] /dev/tty[0-9][0-9]p
		echo "\nThe choices for parallel printer device name are:\n"
		ls -C /dev/lp[0-9]* /dev/tty[0-9][0-9]p
		echo "\nEnter the device name:  \c"
		read dev

	#	Verify that given device is character special.
		if
			[ ! -c "${dev}" ]
		then
			echo "${popt} cannot be hardwired to '${dev}'."
			dev=""
		else

	#	Modify /etc/inittab.

			expr "$dev" : "/dev/tty.*" >/dev/null && lpsetup2 ${dev}
			chmod 600 ${dev}
			chown lp ${dev}
		fi
	done
fi

admopt="-h"

# Let lpadmin install the new printer.
/usr/lib/lpshut
/usr/lib/lpadmin -p${popt} ${admopt} -v${dev} -m${mopt}
if [ $? -eq 0 ]
then
	if [ "X${admopt}" = "X-h" ]
	then
		/usr/lib/accept ${popt}
		if [ $? -eq 0 ]
		then
			enable ${popt}
			if [ $? -ne 0 ]
            then
				echo "Enable of printer ${popt} failed.  Consult documentation."
			fi
		else
			echo "Accept of printer ${popt} failed.  Consult documentation."
		fi
	fi
else
	echo "Installation of printer ${popt} failed.  Consult documentation."
fi
rm -f /usr/spool/lp/SCHEDLOCK
/usr/lib/lpsched