home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / extra_src / uucp_quick.chk < prev   
Text File  |  1992-03-10  |  935b  |  33 lines

  1. #!/bin/sh
  2. #
  3. #   By wietse@wzv.win.tue.nl (Wietse Venema).  This will be folded into
  4. # the rest of cops and the uucp stuff, when I get a breath to take.
  5. #
  6. #
  7. # This script does almost nothing if there is no UUCP account.
  8. # On some systems, even local users can uucp files from selected
  9. # directories only. Often, these are also UUCP login directories,
  10. # and often they are world-writable. Use /tmp as a final resort.
  11.  
  12. for i in /usr/spool/uucppublic /usr/spool/uucp /tmp
  13. do
  14.     if touch $i/XX.$$ 2>/dev/null
  15.     then
  16.         cd $i
  17.         break;
  18.     fi
  19. done
  20.  
  21. # I forgot how COPS deals with the presence or absence of NIS...
  22.  
  23. (cat /etc/passwd ; ypcat passwd) 2>/dev/null | 
  24.     awk -F: '/uucp/ { print $1,$(NF-1) }' | while read user home
  25.     do
  26.         uucp XX.$$ !$home/YY.$$ 2>/dev/null &&
  27.         echo uucp copies files to home directory $home of account $user
  28.     done
  29.  
  30. # Clean up; too bad we cannot unlink the files we may have installed...
  31.  
  32. rm -f XX.$$ $home/YY.$$
  33.