home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / alt / hackers / 1172 < prev    next >
Encoding:
Internet Message Format  |  1992-07-26  |  2.9 KB

  1. Xref: sparky alt.hackers:1172 comp.unix.shell:3138 alt.sources:1758 news.newusers.questions:3432
  2. Path: sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin02!wzv!rob
  3. From: rob@wzv.win.tue.nl (Rob J. Nauta)
  4. Newsgroups: alt.hackers,comp.unix.shell,alt.sources,news.newusers.questions
  5. Subject: Newgroup/rmgroup 1.1
  6. Message-ID: <3676@wzv.win.tue.nl>
  7. Date: 26 Jul 92 10:38:57 GMT
  8. Followup-To: alt.sources.d
  9. Organization: Sex, UNIX & Rock 'n Roll
  10. Lines: 78
  11. Approved: rob@wzv.win.tue.nl
  12.  
  13. This program automates the task of maintaining newsgroups a little.
  14. It's actually one program with 2 names, depending on its name it does
  15. either a newgroup or a rmgroup.
  16. WARNING: creating or removing non-alt and non-local newsgroups will
  17. make you very unpopular, so please don't do that !!
  18.  
  19. Rob
  20. ------------
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of shell archive."
  28. # Contents:  newgroup rmgroup
  29. # Wrapped by rob@wzv on Sun Jul 26 12:31:24 1992
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f newgroup -a "${1}" != "-c" ; then 
  32.   echo shar: Will not over-write existing file \"newgroup\"
  33. else
  34. echo shar: Extracting \"newgroup\" \(964 characters\)
  35. sed "s/^X//" >newgroup <<'END_OF_newgroup'
  36. X#!/bin/sh
  37. X# newgroup/rmgroup 1.1 - Automatically create/remove a useless newsgroup.
  38. X#
  39. X# (c) copyright 1992 Rob J. Nauta (rob@wzv.win.tue.nl). Permission is
  40. X# granted to abuse this program in any way that you want, as long as
  41. X# you don't abuse my name !
  42. X#
  43. X# Some definitions. If they don't work, you can hardcode in other values.
  44. X#
  45. XNNTPSERVER=`hostname`
  46. XWORD='x'
  47. XUSER=`whoami`
  48. XHOST=`hostname`
  49. X#
  50. Xcase `basename $0` in
  51. X'newgroup')    WORD=`basename $0` ;;
  52. X'rmgroup')    WORD=`basename $0` ;;
  53. Xesac
  54. Xcase $WORD in
  55. X'x')    echo "$0 must be called either 'newgroup' or 'rmgroup' !";exit ;;
  56. Xesac
  57. Xcase $1 in
  58. X'')    echo "Usage: $0 <newsgroupname>.";exit ;;
  59. Xesac
  60. X(echo group control
  61. X echo post
  62. X echo Path: $HOST\!$USER
  63. X echo From: $USER@$HOST
  64. X echo Newsgroups: control
  65. X echo Distribution: world
  66. X echo Subject: $WORD $1
  67. X echo Control: $WORD $1
  68. X echo Approved: $USER@$HOST
  69. X echo ''
  70. X echo This group is totally bogus, dude.
  71. X echo .
  72. X echo quit
  73. X sleep 4
  74. X) | telnet $NNTPSERVER 119 >/dev/null
  75. END_OF_newgroup
  76. if test 964 -ne `wc -c <newgroup`; then
  77.     echo shar: \"newgroup\" unpacked with wrong size!
  78. fi
  79. chmod +x newgroup
  80. echo shar: Linking \"rmgroup\" to \"newgroup\".
  81. ln newgroup rmgroup
  82. # end of overwriting check
  83. fi
  84. echo shar: End of shell archive.
  85. exit 0
  86. -- 
  87. /-----------------------------------------------\               ,==.
  88. | Rob J. Nauta, UNIX computer security expert.    |               /@  |
  89. | rob@wzv.win.tue.nl, Phone: +31-40-837549    |              /_  <
  90. | Feel free to email me for free advice        |            =" `g'
  91.