|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: @ T a
Length: 1883 (0x75b)
Types: TextFile
Notes: @(#)add.prt.FTS.sh 13.1 (RC International) 91/08/23
Names: »add.prt.FTS«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/sadm/sysadm/bin/add.prt.FTS«
# @(#)add.prt.FTS.sh 13.1 (RC International) 91/08/23
#
# add.prt.FTS: Add an FTS printer.
#
# /usr/sadm/sysadm/bin/add.prt.FTS
# <printer> <remote host> <remote printer> <vpid>
#
echo
echo "Checking if the printer is running, please wait ...";
if /usr/bin/lpstat -r | grep not > /dev/null
then
echo "Printer scheduler is not running."
else
echo "Stopping the printer scheduler, please wait ..."
/usr/lib/lpshut > /dev/null
fi
echo "Adding printer $1, please wait ..."
intf_file=/tmp/lp.intf.$4
cat > $intf_file << \EOT
#!/bin/sh
#
# FTS NETWORK printer
#
# $0: The printer device
# $1: Request id
# $2: Userid
# $3: The extra title for the front page
# $4: Number of copies of the files
# $5: If h|H no header is wanted
# $6 .... $n are filenames
#
copies=${4:-0}
shift 5
for F in $*
do
N=$copies
while test $N -gt 0
do
EOT
/bin/echo " wr -s$2 -t -p$3 \$F 2>/dev/null" >> $intf_file
cat >> $intf_file << \EOT
N=`expr $N - 1`
done
done
exit 0
EOT
error=/tmp/lp.error.$4
/usr/lib/lpadmin -p$1 -v/dev/null -i$intf_file > /dev/null 2> $error
if [ "$?" != "0" ]
then
echo "When executing the command:"
echo
echo " /usr/lib/lpadmin -p$1 -v/dev/null -i$intf_file"
echo
echo "the following error occurred:"
echo
cat $error
echo
echo "Interface file $intf_file not removed."
echo
rm -f $error
fi
echo "Printer $1 added. Starting the scheduler, please wait ...";
rm -f /usr/spool/lp/SCHEDLOCK
/usr/lib/lpsched > /dev/null
echo "Enabling printer $1, please wait ..."
/usr/bin/enable $1 > /dev/null
echo "Start $1 to accept requests, please wait ..."
/usr/lib/accept $1 > /dev/null
echo
echo "Printer $1 added and ready to accept requsts.";
echo
echo 'Please note that users can only use the following'
echo "options to lp for the printer '$1':"
echo ' -d (destination) and'
echo ' -n (number of copies)'
rm -f $error $intf_file