home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / osr5 / sco / scripts / admin / news / cleangrp < prev    next >
Encoding:
Text File  |  1997-08-26  |  549 b   |  29 lines

  1. :
  2. # @(#) cleangrp.sh 1.0 94/07/15
  3. # 94/07/15 john h. dubois iii (john@armory.com)
  4.  
  5. if [ $# -gt 0 ]; then
  6.     echo \
  7. "$0: Remove files from spool directories for newsgroups that have
  8. been disabled in the active file."
  9.     exit 0
  10. fi
  11.  
  12. newsdir=/usr/spool/news
  13. cd $newsdir
  14. awk '
  15. $NF ~ "x" {
  16.     gsub(/\./,"/",$1)
  17.     print $1
  18. }
  19. ' /usr/lib/news/active | while read groupdir; do
  20.     for file in $groupdir/* $groupdir/.thread; do
  21.     if [ -f "$file" ]; then
  22.         echo "$file"
  23.         echo "$file" 1>&2
  24.     fi
  25.     done
  26.     echo -n "." 1>&2
  27. done | xargs rm -f
  28. echo ""
  29.