Okay here are the interface files working one first LP99
/usr/spool/lp/admins/lp/interfaces/LP99
MODEL=`basename $0`
REALMODEL=`echo $0 | sed -e "s%$MODEL%model.orig/$MODEL%"`
#
# This name may be initialized when the script is
# installed in the spooler. If not, use the name
# of this script ($MODEL) as the peripheral to contact.
#
PERIPH=
if [ "$PERIPH" = "" ]
then
PERIPH=$MODEL
fi
LOG=/tmp/$PERIPH.$$
HPNPF=/usr/lib/hpnp/hpnpf
LPLOG=/tmp/hpnpf.$$
LOGTRIES=5
echo "$1\t$REALMODEL | $HPNPF -x $PERIPH" >> $LPLOG
#
# Remove the log file if job is cancelled
# or the scheduler is shutdown.
#
trap "rm -f $LOG $LPLOG; trap 15;kill -15 0;exit 0" 15
ERRORLOGS=0
while :
do
#
# Save the stderr messages in a temporary log file
# and discard stdout which is the peripheral output.
#
rm -f $LOG
if $REALMODEL "$@" | $HPNPF -x $PERIPH 2> $LOG > /dev/null
then
#
# If the transfer is successful, remove
# the log file and exit.
#
rm -f $LOG $LPLOG
exit 0
else
#
# Added the request ID to the stderr message
# and store it in the lp log file.
#
# Only record the first $LOGTRIES errors. If
# the spooler gets in a loop retrying a job, the
# disk won't fill up with spooler log error messages.
#
if test -s $LOG -a $ERRORLOGS -lt $LOGTRIES
then
echo "$1\t`cat $LOG`" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
if test $ERRORLOGS -eq $LOGTRIES
then
echo "$1\t$LOGTRIES errors logged for $1; errors no longer logged" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
fi
if [ ! -s $LPLOG ]
then
rm -f $LPLOG
fi
sleep 10
done
Non working one, this is the original file that did not
work, not the one I copied the LP99 file onto.
/usr/spool/lp/admins/lp/interfaces/hp5l
MODEL=`basename $0`
REALMODEL=`echo $0 | sed -e "s%$MODEL%model.orig/$MODEL%"`
#
# This name may be initialized when the script is
# installed in the spooler. If not, use the name
# of this script ($MODEL) as the peripheral to contact.
#
PERIPH=
if [ "$PERIPH" = "" ]
then
PERIPH=$MODEL
fi
LOG=/tmp/$PERIPH.$$
HPNPF=/usr/lib/hpnp/hpnpf
LPLOG=/tmp/hpnpf.$$
LOGTRIES=5
echo "$1\t$REALMODEL | $HPNPF -x $PERIPH" >> $LPLOG
#
# Remove the log file if job is cancelled
# or the scheduler is shutdown.
#
trap "rm -f $LOG $LPLOG; trap 15;kill -15 0;exit 0" 15
ERRORLOGS=0
while :
do
#
# Save the stderr messages in a temporary log file
# and discard stdout which is the peripheral output.
#
rm -f $LOG
if $REALMODEL "$@" | $HPNPF -x $PERIPH 2> $LOG > /dev/null
then
#
# If the transfer is successful, remove
# the log file and exit.
#
rm -f $LOG $LPLOG
exit 0
else
#
# Added the request ID to the stderr message
# and store it in the lp log file.
#
# Only record the first $LOGTRIES errors. If
# the spooler gets in a loop retrying a job, the
# disk won't fill up with spooler log error messages.
#
if test -s $LOG -a $ERRORLOGS -lt $LOGTRIES
then
echo "$1\t`cat $LOG`" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
if test $ERRORLOGS -eq $LOGTRIES
then
echo "$1\t$LOGTRIES errors logged for $1; errors no longer logged" >> $LPLOG
ERRORLOGS=`expr $ERRORLOGS + 1`
fi
fi
if [ ! -s $LPLOG ]
then
rm -f $LPLOG
fi
sleep 10
done