123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- #!/bin/sh
-
-
-
-
-
-
-
- DEVICES="bjt600.32 bjc600.32 bjc600.24 bjc600.24.3 bjc600.16 bjc600.8 bjc600.8.1 bjc600.1 bjc600.dq"
-
- FILTERS="if"
-
-
- PRINTERDEV=/dev/lp1
-
- PRINTERTYPE=parallel
-
- GSDIR=/usr/local/lib/ghostscript
- GSFILTERDIR=$GSDIR/filt
- SPOOLDIR=/var/spool
- GSIF=unix-lpr.sh
- PCAP=printcap.insert
-
- PATH=/bin:/usr/bin:/usr/ucb
- export PATH
-
- if [ ! -w $GSDIR ]; then
- echo "$GSDIR must be writable to create filter directory"
- exit 1
- fi
-
- echo "
- Making links in the filter directory $GSFILTERDIR ...
- "
-
-
-
-
- if [ -d $GSFILTERDIR ]; then
- echo "$GSFILTERDIR already exists - not created"
- else
- mkdir $GSFILTERDIR
- fi
- rm -f $GSFILTERDIR/direct
- ln -s . $GSFILTERDIR/direct
- rm -f $GSFILTERDIR/indirect
- ln -s . $GSFILTERDIR/indirect
-
-
-
-
- for filter in $FILTERS
- do
- rm -f $GSFILTERDIR/gs$filter
- ln -s ../$GSIF $GSFILTERDIR/gs$filter
- done
-
-
-
-
- for device in $DEVICES
- do
- dualqueue=
- case "$device" in
- *.dq) device=`basename $device .dq` ; dualqueue=t ;;
- esac
- rm -f $GSFILTERDIR/$device
- if [ $dualqueue ]; then
- rm -f $GSFILTERDIR/indirect/$device
- ln -s . $GSFILTERDIR/indirect/$device
- else
- rm -f $GSFILTERDIR/direct/$device
- ln -s . $GSFILTERDIR/direct/$device
- fi
- done
-
-
-
-
- rm -f $PCAP
- cat > $PCAP << EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- EOF
-
- (
- previous=undefined
- for device in $DEVICES
- do
- dualqueue=
- case "$device" in
- *.dq) device=`basename $device .dq` ; dualqueue=t ;;
- esac
- base="`echo $device | sed 's/\.[0-9][0-9]*$//'`"
- base="`echo $base | sed 's/\.[0-9][0-9]*$//'`"
-
-
-
- if [ $dualqueue ]; then
- if [ $base != $previous ]; then
- previous=$base
- echo "\
- # Entry for raw device $base.raw
- $base.raw|Raw output device $base:\\
- :lp=$PRINTERDEV:\\"
- if test "$PRINTERTYPE" = serial
- then
- echo "br#19200:xc#0177777:\\"
- echo ":ms=-parity,ixon,-opost:\\"
- fi
- echo ":sd=$SPOOLDIR/$base/raw:\\
- :mx#0:sf:sh:rs:"
- fi
- echo "\
- # Entry for device $device (output to $base.raw)
- $device|Ghostscript device $device:\\
- :lp=/dev/null:\\"
- else
- echo "\
- # Entry for device $device
- $device|Ghostscript device $device:\\
- :lp=$PRINTERDEV:\\"
- if test "$PRINTERTYPE" = serial
- then
- echo "br#19200:xc#0177777:\\"
- echo ":ms=-parity,ixon,-opost:\\"
- fi
- fi
- echo "\
- :sd=$SPOOLDIR/$base:\\
- :lf=$SPOOLDIR/$base/logfile:\\
- :af=$SPOOLDIR/$base/acct:\\"
- for filter in $FILTERS
- do
- if [ $dualqueue ]; then
- echo "\
- :$filter=$GSFILTERDIR/indirect/$device/gs$filter:\\"
- else
- echo "\
- :$filter=$GSFILTERDIR/direct/$device/gs$filter:\\"
- fi
- done
- echo "\
- :mx#0:sf:sh:rs:"
- done
- ) >> $PCAP
-
- echo "
- Example printcap insert file \"$PCAP\" now created"
-
-
-
-
-
- echo "
- NB/ You will need to create the following directories, with
- appropriate permissions, and do 'touch logfile' and 'touch acct'
- in the top level directories (ie. not the 'raw' ones):
- "
- (
- for device in $DEVICES
- do
- dualqueue=
- case "$device" in
- *.dq) device=`basename $device .dq` ; dualqueue=t ;;
- esac
- base="`echo $device | sed 's/\.[0-9][0-9]*$//'`"
- base="`echo $base | sed 's/\.[0-9][0-9]*$//'`"
- echo " $SPOOLDIR/$base"
- if [ $dualqueue ]; then
- echo " $SPOOLDIR/$base/raw"
- fi
- done
- ) | sort -u
-
- echo "
- + + + "
|