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

  1. From: scott@zorch.SF-Bay.ORG (Scott Hazen Mueller)
  2. Newsgroups: alt.config,alt.sources,news.software.b
  3. Subject: Re: manual newgroup for C news
  4. Message-ID: <1990May24.144503.12544@zorch.SF-Bay.ORG>
  5. Date: 24 May 90 14:45:03 GMT
  6.  
  7. In article <90May22.235719edt.19970@me.utoronto.ca> eastick@me.utoronto.ca (Doug Eastick) writes:
  8. >Since I'm passing on the usenet alias to someone else,  I thought I'd
  9. >ease the pain of all the stupid newgroups in alt.*.  Now it just tells
  10. >you to do an addgroup alt.dorkheads (aw jeez, now some dork will
  11. >actually go out and do it!).  Replaces $NEWSBIN/ctl/newgroup.
  12.  
  13. Since I'm not the first, I thought that I'd pass along my versions of
  14. ctl/newgroup and ctl/rmgroup.  Also hacked to only pass a message, but sends
  15. along any message text from the original control article.
  16.  
  17. #! /bin/sh
  18. # newgroup group flag - create group (4-field version: B-2.10.3+ compatible)
  19. #    subject to our sys file group pattern
  20.  
  21. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  22. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  23. export NEWSCTL NEWSBIN NEWSARTS
  24. PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir
  25. umask $NEWSUMASK
  26.  
  27. afile=/tmp/ncd
  28. afilehdr=/tmp/ncdhdr
  29. afilebody=/tmp/ncdbody
  30. hdr=/tmp/nc$$
  31.  
  32. trap "rm -f $hdr $afile*; exit 0" 0
  33. $NEWSBIN/inject/tear $afile
  34. $NEWSBIN/canonhdr <$afilehdr >$hdr
  35.  
  36. # unapproved ctl msg? then quit
  37. grep -s '^Approved:' $hdr >/dev/null || { rm -f $hdr; exit 0; }
  38.  
  39. SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
  40. case "$SENDER" in
  41. "")    SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//' `" ;;
  42. esac
  43.  
  44. ( echo "Subject: newgroup $1 $2"; echo "$SENDER says:";
  45. cat $afilebody ) | mail $NEWSMASTER
  46.  
  47.  
  48. #! /bin/sh
  49. # rmgroup group - snuff group
  50.  
  51. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  52. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  53. export NEWSCTL NEWSBIN NEWSARTS
  54. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  55. umask $NEWSUMASK
  56.  
  57. afile=/tmp/ncd
  58. afilehdr=/tmp/ncdhdr
  59. afilebody=/tmp/ncdbody
  60. hdr=/tmp/nc$$
  61.  
  62. $NEWSBIN/inject/tear $afile
  63. $NEWSBIN/canonhdr <$afilehdr >$hdr
  64.  
  65. # unapproved ctl msg? then quit
  66. egrep '^Approved:' $hdr >/dev/null || { rm -f $afile*; exit 0; }
  67.  
  68. # quit if no active entry
  69. egrep "^`echo $1 | sed 's/\./\\\\./g'` " $NEWSCTL/active >/dev/null ||
  70.     { rm -f $hdr $afile*; exit 0; }
  71.  
  72. SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
  73. case "$SENDER" in
  74. "")    SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//'`" ;;
  75. esac
  76.  
  77. # tell the local usenet administrator to do it by hand
  78. ( echo "Subject: rmgroup $1"; echo "$SENDER says:";
  79. cat $afilebody ) | mail $NEWSMASTER
  80.  
  81. rm -f $hdr $afilehdr $afilebody
  82.  
  83.  
  84. -- 
  85. Scott Hazen Mueller | scott@zorch.SF-Bay.ORG or (ames|pyramid|vsi1)!zorch!scott
  86. 10122 Amador Oak Ct.|(408) 253-6767     |Mail fusion-request@zorch.SF-Bay.ORG
  87. Cupertino, CA  95014|Love make, not more|for emailed sci.physics.fusion digests
  88. SF-Bay Public-Access Unix 408-996-7358/61/78/86 login newuser password public
  89.