home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / protocol / tcpip / ibmpc / 6950 < prev    next >
Encoding:
Text File  |  1992-12-15  |  3.9 KB  |  109 lines

  1. Newsgroups: comp.protocols.tcp-ip.ibmpc
  2. Path: sparky!uunet!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!news.edu.tw!news!jekyll.ee.nctu.edu.tw!twins!eea78555
  3. From: eea78555@twins (Hwan-Rei Lee)
  4. Subject: Re: Unix LPR/LPD server for IBM PC?
  5. Message-ID: <1992Dec16.074426.5982@jekyll.ee.nctu.edu.tw>
  6. Sender: usenet@jekyll.ee.nctu.edu.tw (USENET NETNEWS ACCOUNT)
  7. Nntp-Posting-Host: twinsgw
  8. Organization: EENCTU
  9. X-Newsreader: Tin 1.1 PL3
  10. References: <1992Dec11.150926.28474@alf.uib.no>
  11. Date: Wed, 16 Dec 1992 07:44:26 GMT
  12. Lines: 95
  13.  
  14. iversen@dsfys1.fi.uib.no (Per Steinar Iversen) writes:
  15. : Is there available a package that allows an old PC AT with an Ethernet card to 
  16. : serve as an LPR/LPD server for a fast PostScript printer? The printer is to be 
  17. : used in a mixed network, the best solution would seem to be the Unix LPR 
  18. : protocol. I have seen announcements of router and bridge software for PCs....
  19. : Could this be done Pathworks?
  20. : -psi
  21.     Hi!:
  22.     I have just written two small shell scripts for both PC and Sun that
  23. makes  PC serves as a printer spooler for Workstation. Our enviroment is
  24. under PC/NFS by which we mount a directory under PC from Sun. And PC
  25. look for files under that directory and prints out whenever it detects
  26. files in that directory. ( Of course, some handshake files are needed
  27. for acknowleging the printer ready, ... ). The scripts are listed below.
  28. Hope it helps.
  29. ########## lpx in Sun, Csh ##########
  30. #! /bin/csh -f
  31.     if ( ! -f /twins-1/local/spool/print.ok ) then
  32.         echo Printer Busy!
  33.         echo Check if someone using PC-286 or Not in Spooling Mode
  34.         exit
  35.     endif
  36. echo Printing Postsrcipt files to PC
  37.     if ( -f /twins-1/local/spool/print.can) then
  38.     echo Printer Busy!
  39.     echo Submit later!
  40.     exit
  41. endif
  42. foreach arg ( $argv )
  43.     echo Submitting: $arg
  44.     if ( -f /twins-1/local/spool/print.ok) then
  45.         cp $arg /twins-1/local/spool
  46.         chmod 777 /twins-1/local/spool/$arg
  47.     else
  48.         echo File Not Found!
  49.     exit
  50.     endif
  51. end
  52. echo OK > /twins-1/local/spool/print.can
  53. chmod 777 /twins-1/local/spool/print.can
  54. echo Use lpxq to check files at printing.
  55. echo Use lpxd to remove unprinted files.
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57. ################# lpxq in Sun 
  58. #! /bin/csh -f
  59. ls -l /twins-1/local/spool
  60. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  61. ################# lpxd in Sun 
  62. #! /bin/csh -f
  63. foreach arg ( $argv )
  64.     echo Removing file: $arg
  65.     if ( -f /twins-1/local/spool/$arg) then
  66.         rm /twins-1/local/spool/$arg
  67.     else
  68.         usage: lpxd filename
  69.     exit
  70.     endif
  71. end
  72. rm -f /twins-1/local/spool/print.can  >& /dev/null
  73. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  74. ################# Spool.bat in PC-nfs using 4DOS batch commands for PC
  75. @echo off
  76. echo Waiting for Printing...
  77. echos %_cwd`>`
  78. iff %@ready[k:]==0 then ^ echo Spooler Directory not ready ^ goto end ^ endiff
  79. loadbtm on
  80. iff "%spool"=="spool" then ^ goto begin ^ endiff 
  81. alias prompt=echo Do not Change Prompt In Spooler Mode!
  82. iff exist k:\spool.bat then ^ copy k:\spool.bat c:\etc ^ endiff
  83. if not "%aon"=="aon" call aon.bat ^ set aon=aon
  84. net use k: /d >& NUL
  85. NET USE k: \\twins\twins-1\local\spool /sh  >& nul
  86. del k:\print.ok /q >& nul
  87. set spool=spool
  88. :begin
  89. if %@exec[c:\bin\kbhit.exe]==1  goto done 
  90. iff %@ready[k:] != 1 then ^ goto end ^ endiff
  91. iff not exist k:\print.ok then ^ echo OK > k:\print.ok ^ endiff
  92. iff not exist k:\print.can then ^ goto begin ^ endiff
  93. del k:\print.ok /q  >& NUL
  94. delay 1
  95. for %a in ( k:\*.ps ) do ( echo Printing %a .... ^ copy %a c:\tmp\temp.ps /q^ iff %@lpt[3] == 1  then ^ copy c:\tmp\temp.ps lpt3: ^ del c:\tmp\temp.ps /qy  ^ endiff )
  96. for %a in ( k:\*.txt ) do ( echo Printing %a ....^ c:\nfs\unix2dos %a >  c:\tmp\temp.txt ^ text2ps c:\tmp\temp.txt > c:\tmp\temp.ps ^ copy c:\tmp\tmp.ps lpt3: )
  97. del k:\*.ps /q >& nul
  98. del k:\*.txt /q >& nul
  99. del k:\print.can /q >& nul
  100. echos %_cwd`>`
  101. goto begin
  102. :done
  103. iff "%p"=="" then^ set p=s ^ set prompt=`%@exec[c:\etc\spool.bat]`[1D ^ endiff
  104. del k:\print.ok /q  >& NUL
  105. :end 
  106.