#!/bin/sh 

# CUSTOMIZE HERE
# this is the local print queue
# test with: lp -d thisvalue file_to_print
#
# $HeadURL: http://pc2.ecs.csus.edu/repos/pc2v9/branches/PC2_RELEASE_9_2_x/samps/scripts/loopprint $

PRINTER=balloon

# use this value in the balloon "Print Device(Port)"
# may need to change this to a user writable directory
FIFO=/dev/balloonprinter

# the rest should not change

if [ -e $FIFO ]; then
	if [ ! -p $FIFO ]; then
		echo $FIFO is not a pipe, cannot continue
		exit 2
	fi
else
	# make the pipe
	mkfifo $FIFO
	# attempt to clean up after ourselves
	trap 'rm -f $FIFO;exit 0' 0
fi

while /bin/true
do

	cat $FIFO | lp -d $PRINTER

done

# eof $Id: loopprint 2090 2010-04-10 19:28:54Z laned $