home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / NN / _NN-NNTP.TAR / usr / lib / nn / nnspew < prev    next >
Encoding:
Text File  |  1994-09-13  |  852 b   |  42 lines

  1. #!/bin/sh
  2.  
  3. # Generated by nn release 6.4.18
  4.  
  5. VERSION="6.4.18"
  6. INEWS="/usr/bin/inews"
  7. INEWS_DIR="/usr/bin"
  8. AWK="awk"
  9. NNTP=true
  10. ACTIVE=/var/spool/nn/ACTIVE
  11. NNTPCACHE=
  12. LOG=/usr/lib/nn/Log
  13. TMP=${TMPDIR-/usr/tmp}
  14. DB=/var/spool/nn
  15. BIN=/usr/bin
  16. LIB=/usr/lib/nn
  17. AUTH=false
  18.  
  19. # ---- end of prefix
  20.  
  21. # nnspew -- generate subject line database
  22. #
  23. # From: James A. Woods (ames!jaw), NASA Ames Research Center
  24. #
  25. # Updates the auxiliary 'subjects' file.  It must be activated regularly
  26. # via a system-wide 'cron' or 'at' command, e.g.
  27. #
  28. #     2 6,9,12,15,18,21 * * *  root /bin/nice /usr/lib/nn/nnspew
  29.  
  30. trap "rm -f $TMP/nnsubj$$* ; exit" 0 1 2 15
  31.  
  32. # We use a "secret" 'nn -SPEW' call to do the hard part:
  33.  
  34. if $BIN/nn -SPEW < /dev/null > $TMP/nnsubj$$a
  35. then
  36.     if sort -u $TMP/nnsubj$$a > $TMP/nnsubj$$b
  37.     then
  38.         mv $TMP/nnsubj$$b $DB/subjects
  39.         chmod 644 $DB/subjects
  40.     fi
  41. fi
  42.