home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky alt.hackers:1172 comp.unix.shell:3138 alt.sources:1758 news.newusers.questions:3432
- Path: sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin02!wzv!rob
- From: rob@wzv.win.tue.nl (Rob J. Nauta)
- Newsgroups: alt.hackers,comp.unix.shell,alt.sources,news.newusers.questions
- Subject: Newgroup/rmgroup 1.1
- Message-ID: <3676@wzv.win.tue.nl>
- Date: 26 Jul 92 10:38:57 GMT
- Followup-To: alt.sources.d
- Organization: Sex, UNIX & Rock 'n Roll
- Lines: 78
- Approved: rob@wzv.win.tue.nl
-
- This program automates the task of maintaining newsgroups a little.
- It's actually one program with 2 names, depending on its name it does
- either a newgroup or a rmgroup.
- WARNING: creating or removing non-alt and non-local newsgroups will
- make you very unpopular, so please don't do that !!
-
- Rob
- ------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: newgroup rmgroup
- # Wrapped by rob@wzv on Sun Jul 26 12:31:24 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f newgroup -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"newgroup\"
- else
- echo shar: Extracting \"newgroup\" \(964 characters\)
- sed "s/^X//" >newgroup <<'END_OF_newgroup'
- X#!/bin/sh
- X# newgroup/rmgroup 1.1 - Automatically create/remove a useless newsgroup.
- X#
- X# (c) copyright 1992 Rob J. Nauta (rob@wzv.win.tue.nl). Permission is
- X# granted to abuse this program in any way that you want, as long as
- X# you don't abuse my name !
- X#
- X# Some definitions. If they don't work, you can hardcode in other values.
- X#
- XNNTPSERVER=`hostname`
- XWORD='x'
- XUSER=`whoami`
- XHOST=`hostname`
- X#
- Xcase `basename $0` in
- X'newgroup') WORD=`basename $0` ;;
- X'rmgroup') WORD=`basename $0` ;;
- Xesac
- Xcase $WORD in
- X'x') echo "$0 must be called either 'newgroup' or 'rmgroup' !";exit ;;
- Xesac
- Xcase $1 in
- X'') echo "Usage: $0 <newsgroupname>.";exit ;;
- Xesac
- X(echo group control
- X echo post
- X echo Path: $HOST\!$USER
- X echo From: $USER@$HOST
- X echo Newsgroups: control
- X echo Distribution: world
- X echo Subject: $WORD $1
- X echo Control: $WORD $1
- X echo Approved: $USER@$HOST
- X echo ''
- X echo This group is totally bogus, dude.
- X echo .
- X echo quit
- X sleep 4
- X) | telnet $NNTPSERVER 119 >/dev/null
- END_OF_newgroup
- if test 964 -ne `wc -c <newgroup`; then
- echo shar: \"newgroup\" unpacked with wrong size!
- fi
- chmod +x newgroup
- echo shar: Linking \"rmgroup\" to \"newgroup\".
- ln newgroup rmgroup
- # end of overwriting check
- fi
- echo shar: End of shell archive.
- exit 0
- --
- /-----------------------------------------------\ ,==.
- | Rob J. Nauta, UNIX computer security expert. | /@ |
- | rob@wzv.win.tue.nl, Phone: +31-40-837549 | /_ <
- | Feel free to email me for free advice | =" `g'
-