mhcc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/rc
  2. # send PostScript jobs to the spooler in the MHCC
  3. # Request is made for bin and account numbers for each file (for typing pool).
  4. if (! ~ $DEBUG '') flag x +
  5. FONTLIST=lw+
  6. if (test -r /sys/lib/postscript/font/$LPDEST) FONTLIST=$LPDEST
  7. switch ($LPCLASS) {
  8. case *duplex*; DUPLEX=-s2
  9. case ''; DUPLEX=''
  10. }
  11. HOLE=''
  12. STAPLE='-KSTAPLES\ n'
  13. TRAY=''
  14. if (~ $IBIN vg view viewgr*;) $VGS=-fvg
  15. if (~ $IBIN *hole*) HOLE=-fhole
  16. if (~ $IBIN *staple*) STAPLE=''
  17. if (~ $IBIN *simplex*) DUPLEX=''
  18. if (~ $IBIN *11x17* *ledger*) TRAY='-KTRAY\ 11x17tray'
  19. if (~ $LAND '' -pport) LAND=-pport
  20. if not LAND=-pland
  21. i=0
  22. if (~ $#* 0) *=''
  23. for (j) {
  24. i=`{echo $i + 1 | hoc}
  25. # check access to the file so that you know that a failure in the
  26. # processing is a drastic error which will cause an exit from lp.
  27. if (~ $j '' || test -f $j) {
  28. while (~ $#ACCOUNT 0 || ~ $ACCOUNT '' *0000) {
  29. echo -n 'account=' >/dev/cons
  30. ACCOUNT = (`{read</dev/cons})
  31. }
  32. while (~ $#BIN 0 || ~ $BIN '' *000) {
  33. echo -n 'bin=' >/dev/cons
  34. BIN = (`{read</dev/cons})
  35. }
  36. switch ($j) {
  37. case ''; @{ bind -b $LPLIB/process /bin; $LPPROC } |
  38. /sys/lib/postscript/bin/$cputype/download -f -H/sys/lib/postscript/font -mfontmap -p$FONTLIST |
  39. {echo -K'ACCTNUM\ '$ACCOUNT -K'BIN\ '$BIN -d$LPDEST -c$COPIES -lpostscript $VGS $HOLE $STAPLE $DUPLEX $LAND $TRAY -u$LPUSERID -j$LPMACHID$pid.$i
  40. cat} | lpsend.rc $DEST_HOST
  41. case *; @{ bind -b $LPLIB/process /bin; $LPPROC } < $j |
  42. /sys/lib/postscript/bin/$cputype/download -f -H/sys/lib/postscript/font -mfontmap -p$FONTLIST |
  43. {echo -K'ACCTNUM\ '$ACCOUNT -K'BIN\ '$BIN -d$LPDEST -c$COPIES -lpostscript $VGS $HOLE $STAPLE $DUPLEX $LAND $TRAY -u$LPUSERID -j$LPMACHID$pid.$i
  44. cat $j} | lpsend.rc $DEST_HOST
  45. }
  46. }
  47. }