|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T U
Length: 4481 (0x1181)
Types: TextFile
Notes: Uncompressed file
└─⟦5a9f1bdbd⟧ Bits:30004698 RC900 Environment Rel. 2.0 (5.25 inch)
└─⟦5a9f1bdbd⟧ UNIX Filesystem
└─⟦015d91a02⟧ »RCENV.ISC/new/usr/lbin/rclpset1.Z«
└─⟦de58d8f44⟧ Bits:30004699 RC900 Environment Rel. 2.0 (3.5 inch)
└─⟦de58d8f44⟧ UNIX Filesystem
└─⟦015d91a02⟧ »RCENV.ISC/new/usr/lbin/rclpset1.Z«
└─⟦this⟧
#ident "@(#)rclpset1.sh 1.1 - 91/10/17"
#
# 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
if test ! -s $MODEL/$2
then
echo "Model $2 Not found" >&2
exit 1
fi
mopt="$2"
# 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}"}
inchrset=""
outchrset=""
# check remote printer
echo "Do you want this printer to be a remote FTS printer."
echo "Enter hostname or return to continue: \c"
read host
rc39=No
if [ "$host" != "" ]
then
dev=/dev/lpnull
if test -d /tcb -a ! -c $dev; then
mknod $dev c 4 2
fi
chmod 600 ${dev}
chown lp ${dev}
while test -z "$rpopt"
do
echo "What printer on $host: \c"
read rpopt
done
outchrset=""
while test -z "$outchrset"
do
echo "Which type is $host (ISC unix, SCO unix, rc39, rc8000, rc9000): \c"
read outchrset
case "$outchrset" in
ISC*) outchrset="i" ;;
SCO*) outchrset="I" ;;
rc8000) outchrset="7" ;;
rc9000) outchrset="I" ;;
rc39) outchrset="7"; rc39=Yes;;
*) outchrset="" ;;
esac
done
fi
while [ "${dev}" = "" ]
do
printers=`ls -C /dev/tty[0-9][0-9] /dev/lp[0-9]* 2>/dev/null`
test -n "$printers" &&
echo "\nThe choices for serial and parallel printer device name are:\n" "$printers"
printers=`ls -C /dev/lph[0-9][0-9] 2>/dev/null`
test -n "$printers" &&
echo "\nThe choices for LAN printer device name are:\n" "$printers"
printers=`ls -C /dev/ttym[12][0-9]p 2>/dev/null`
test -n "$printers" &&
echo "\nThe choices for MUX printer device name are:\n" "$printers"
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.
grep "$dev" /etc/inittab >/dev/null && lpsetup2 ${dev}
chmod 600 ${dev}
chown lp ${dev}
fi
done
while test "$outchrset" = ""
do
outchrset=`checklist -eftp -H "
The DOS850 characterset is normaly used by DOS programs and
by INTERACTIVE Unix systems.
The ISO8859 characterset is normaly used by SCO Unix and
RC9000 Tx Unix Systems." -D "DOS850" \
"Select the printer characterset (DOS):" \
"DOS850" "ISO8859"`
case "$outchrset" in
DOS850) outchrset="i";;
ISO8859) outchrset="I";;
*) echo "Answer DOS or ISO"
outchrset="";;
esac
done
while test "$inchrset" = ""
do
inchrset=`checklist -eftp -H "
The DOS850 characterset is normaly used by DOS programs and
by INTERACTIVE Unix systems.
The ISO8859 characterset is normaly used by SCO Unix and
RC9000 Tx Unix Systems." -D "DOS850" \
"Select the application characterset (DOS):" \
"DOS850" "ISO8859"`
case "$inchrset" in
DOS850) inchrset="i";;
ISO8859) inchrset="I";;
*) echo "Answer DOS or ISO"
inchrset="";;
esac
done
if test -n "$host" -o "$inchrset" != "$outchrset"
then
iopt="/tmp/lpmgmt$$"
trap "rm -f $iopt; exit 0" 0
if test -n "$host"
then echo "(" > $iopt
else > $iopt
fi
if test "$rc39" = "Yes"
then
echo "# Don't let rc39 fiddle with data" >> $iopt
echo "echo '\\\\033\\\\033\\\\022\\\\c'" >> $iopt
fi
if test "$inchrset" != "$outchrset"
then FILTCMD=" | filt -f${inchrset}${outchrset}"
sed -e 's/ #FILT-CMD/'"$FILTCMD"'/p' $MODEL/$mopt >> $iopt
else cat $MODEL/$mopt >> $iopt
fi
if test "$rc39" = "Yes"
then
echo "# Let rc39 fiddle with data" >> $iopt
echo "echo '\\\\033\\\\033\\\\021\\\\c'" >> $iopt
fi
if test -n "$host"
then
if test i = "$outchrset" ; then
echo ") | wr -q -s$host -t -c \"lp -oh -s -d $rpopt\""
else
echo ") | wr -q -s$host -t -p $rpopt"
fi >> $iopt
fi
fi
admopt="-h"
# Let lpadmin install the new printer.
if test -n "$iopt"
then /usr/lib/lpadmin -p${popt} ${admopt} -v${dev} -i${iopt}
else /usr/lib/lpadmin -p${popt} ${admopt} -v${dev} -m${mopt}
fi
if [ $? -ne 0 ]
then
echo "Installation of printer ${popt} failed. Consult documentation."
exit 1
fi
if [ "X${admopt}" != "X-h" ]
then
exit 1
fi
/usr/lib/accept ${popt}
if [ $? -ne 0 ]
then
echo "Accept of printer ${popt} failed. Consult documentation."
exit 1
fi
enable ${popt}
if [ $? -ne 0 ]
then
echo "Enable of printer ${popt} failed. Consult documentation."
exit 1
fi
exit 0