home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2352 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  4.9 KB

  1. From: woods@eci386.uucp (Greg A. Woods)
  2. Newsgroups: comp.sys.att,alt.sources,u3b.sources
  3. Subject: Re: Printing through UUCP
  4. Message-ID: <1990Dec16.192259.29083@eci386.uucp>
  5. Date: 16 Dec 90 19:22:59 GMT
  6.  
  7. In article <11702@ccncsu.ColoState.EDU> hallt@handel.CS.ColoState.Edu (Tim C. Hall) writes:
  8. >     We have two AT&T 3B2 hosts running UUCP.  One has a printer attached,
  9. > and we wish to allow the other host to send print jobs remotely via UUCP.
  10. > How is this best achieved?  Any comments, or, better yet, experiences
  11. > with accomplishing the above feat would be highly appreciated.  Please
  12. > send all replies to thall%spacecom.spacenet-gw.af.mil@server.af.mil
  13. > Thanks for all your help.
  14.  
  15. No problem.  Here are a couple of handy lp model scripts that I've
  16. used with great success.  To set them up, the "server" (i.e. the
  17. machine with the printer), must have an appropriately configured lp,
  18. and have UUCP permissions for 'lp', and perhaps 'uncompress', made
  19. available to the client machines:
  20.  
  21. The file remote_mach contains a list of printers and the machines to
  22. which they are attatched.  Lp on all machines should be configured
  23. with the same printer names on all machines.
  24.  
  25. Note:  I use this with some SysVr3.0 and SysVr3.1 machines (and it
  26. will work on 3b1's too), but I've never had much chance to do anything
  27. like this for SysVr3.2.  I suspect 3.2 has more complex facilities to
  28. do the same thing.
  29.  
  30. #! /bin/sh
  31. # This is a shell archive.  Remove anything before this line, then feed it
  32. # into a shell via "sh file" or similar.  To overwrite existing files,
  33. # type "sh file -c".
  34. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  35. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  36. # If this archive is complete, you will see the following message at the end:
  37. #        "End of shell archive."
  38. # Contents:  usr/spool/lp/remote_mach
  39. #   usr/spool/lp/interface/AppleLaser
  40. #   usr/spool/lp/interface/AppleLaserZ
  41. # Wrapped by woods@eci386 on Sun Dec 16 14:14:14 1990
  42. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  43. if test -f 'usr/spool/lp/remote_mach' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'usr/spool/lp/remote_mach'\"
  45. else
  46. echo shar: Extracting \"'usr/spool/lp/remote_mach'\" \(33 characters\)
  47. sed "s/^X//" >'usr/spool/lp/remote_mach' <<'END_OF_FILE'
  48. XAppleLaser    gate
  49. XAppleLaserZ    gate
  50. END_OF_FILE
  51. if test 33 -ne `wc -c <'usr/spool/lp/remote_mach'`; then
  52.     echo shar: \"'usr/spool/lp/remote_mach'\" unpacked with wrong size!
  53. fi
  54. # end of 'usr/spool/lp/remote_mach'
  55. fi
  56. if test -f 'usr/spool/lp/interface/AppleLaser' -a "${1}" != "-c" ; then 
  57.   echo shar: Will not clobber existing file \"'usr/spool/lp/interface/AppleLaser'\"
  58. else
  59. echo shar: Extracting \"'usr/spool/lp/interface/AppleLaser'\" \(517 characters\)
  60. sed "s/^X//" >'usr/spool/lp/interface/AppleLaser' <<'END_OF_FILE'
  61. X#
  62. X# lp interface for a remote printer
  63. X#
  64. X#
  65. XPATH=/bin:/usr/bin:/usr/lbin:/usr/local/bin ; export PATH
  66. X
  67. XPRINTER=`basename $0`
  68. XTITLE=$3
  69. XCOPIES=$4
  70. XOPTIONS=$5
  71. Xshift; shift; shift; shift; shift
  72. Xfiles="$*"
  73. X
  74. XMACHINE=`mktable /usr/spool/lp/remote_mach | awk '$1~/^'$PRINTER'$/ {print $2}'`
  75. X
  76. Xecho "`date +%D-%T`:$PRINTER:$MACHINE:$RAW:-t$TITLE:-o$OPTIONS:-n$COPIES:$files" >> /usr/spool/lp/remlog
  77. X
  78. Xfor F in $files
  79. Xdo
  80. X    FILES="$FILES !$F"
  81. Xdone
  82. Xuux -n -C "$MACHINE!lp -c -d$PRINTER '-t$TITLE' '-o$OPTIONS' -n$COPIES $FILES"
  83. Xexit 0
  84. END_OF_FILE
  85. if test 517 -ne `wc -c <'usr/spool/lp/interface/AppleLaser'`; then
  86.     echo shar: \"'usr/spool/lp/interface/AppleLaser'\" unpacked with wrong size!
  87. fi
  88. chmod +x 'usr/spool/lp/interface/AppleLaser'
  89. # end of 'usr/spool/lp/interface/AppleLaser'
  90. fi
  91. if test -f 'usr/spool/lp/interface/AppleLaserZ' -a "${1}" != "-c" ; then 
  92.   echo shar: Will not clobber existing file \"'usr/spool/lp/interface/AppleLaserZ'\"
  93. else
  94. echo shar: Extracting \"'usr/spool/lp/interface/AppleLaserZ'\" \(523 characters\)
  95. sed "s/^X//" >'usr/spool/lp/interface/AppleLaserZ' <<'END_OF_FILE'
  96. X#
  97. X# lp interface for a remote printer
  98. X#
  99. X#
  100. XPATH=/bin:/usr/bin:/usr/lbin:/usr/local/bin ; export PATH
  101. X
  102. XPRINTER=`basename $0`
  103. XTITLE=$3
  104. XCOPIES=$4
  105. XOPTIONS=$5
  106. Xshift; shift; shift; shift; shift
  107. Xfiles="$*"
  108. X
  109. XMACHINE=`mktable /usr/spool/lp/remote_mach | awk '$1~/^'$PRINTER'$/ {print $2}'`
  110. X
  111. Xecho "`date +%D-%T`:$PRINTER:$MACHINE:$RAW:-t$TITLE:-o$OPTIONS:-n$COPIES:$files" >> /usr/spool/lp/remlog
  112. X
  113. Xfor F in $files
  114. Xdo
  115. X    uux -n -C "$MACHINE!uncompress < !$F | lp -c -d`basename $PRINTER Z` '-t$TITLE' '-o$OPTIONS' -n$COPIES"
  116. Xdone
  117. Xexit 0
  118. END_OF_FILE
  119. if test 523 -ne `wc -c <'usr/spool/lp/interface/AppleLaserZ'`; then
  120.     echo shar: \"'usr/spool/lp/interface/AppleLaserZ'\" unpacked with wrong size!
  121. fi
  122. chmod +x 'usr/spool/lp/interface/AppleLaserZ'
  123. # end of 'usr/spool/lp/interface/AppleLaserZ'
  124. fi
  125. echo shar: End of shell archive.
  126. exit 0
  127. -- 
  128.                             Greg A. Woods
  129. woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP        ECI and UniForum Canada
  130. +1-416-443-1734 [h]  +1-416-595-5425 [w]  VE3TCP    Toronto, Ontario CANADA
  131. Political speech and writing are largely the defense of the indefensible-ORWELL
  132.