home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / NN / _NN-SPOO.TAR / usr / lib / nn / nnspew < prev    next >
Encoding:
Text File  |  1994-09-13  |  842 b   |  41 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=false
  10. ACTIVE=/var/lib/news/active
  11. LOG=/usr/lib/nn/Log
  12. TMP=${TMPDIR-/usr/tmp}
  13. DB=/var/spool/nn
  14. BIN=/usr/bin
  15. LIB=/usr/lib/nn
  16. AUTH=false
  17.  
  18. # ---- end of prefix
  19.  
  20. # nnspew -- generate subject line database
  21. #
  22. # From: James A. Woods (ames!jaw), NASA Ames Research Center
  23. #
  24. # Updates the auxiliary 'subjects' file.  It must be activated regularly
  25. # via a system-wide 'cron' or 'at' command, e.g.
  26. #
  27. #     2 6,9,12,15,18,21 * * *  root /bin/nice /usr/lib/nn/nnspew
  28.  
  29. trap "rm -f $TMP/nnsubj$$* ; exit" 0 1 2 15
  30.  
  31. # We use a "secret" 'nn -SPEW' call to do the hard part:
  32.  
  33. if $BIN/nn -SPEW < /dev/null > $TMP/nnsubj$$a
  34. then
  35.     if sort -u $TMP/nnsubj$$a > $TMP/nnsubj$$b
  36.     then
  37.         mv $TMP/nnsubj$$b $DB/subjects
  38.         chmod 644 $DB/subjects
  39.     fi
  40. fi
  41.