🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #3685

Re: unsubscribe ALL groups?

#3685
From: Kristian Koehntopp
Date: Fri, 29 Jan 1993 13:42
104 lines
3739 bytes
In <1k20g1INN80@tamsun.tamu.edu> wdevine@andrew.cea.pvamu.edu (William Devine II) writes:
>Is there anyway to have a new .newsrc file put a new users directory that
>has all of the groups unselected?  Also, if this is possible, how could
>they edit the .newsrc file with vi to add whichever and only whichever groups
>they desired.  This is the much preferred way than to have to go to 
>all 2800 groups and Unsubscribe.  any takers?

At tpki.toppoint.de upon creation of a new user the following
script (and many more) is being run. The script unsubscribes to
all groups but tp.* and kiel.* (which are local). Thus, new
users are not being hit by 2800 groups with n thousand unread
articles.

Kristian

#
# @(#) newsrc - Creation/deletion of the users .newsrc
#
# (C) Copyright 1991 Kristian Koehntopp
#     All rights reserved.
#
# The script is being called from mkuser with a preinitialized
# environment. It will create a .newsrc in the users $HOME.	
#
# 15 Nov 1991  KK  file created.
#

# Create .newsrc from active file
ACTIVE=/usr/local/lib/news/active

##############################################################################
#
# Put a .newsrc to stdout.
#
newsrcfile()
{
  # All groups will be unsubscribed except for the local
  # groups tp.* and kiel.*
  cat $ACTIVE | sort | awk '
match($1, /^tp\./) || match($1, /^kiel\./) {
  printf "%s:\n", $1
}

! (match($1, /^tp\./) || match($1, /^kiel\./)) {
  printf "%s!\n", $1
}
' 
}

##############################################################################
#
# create .newsrc (MK_ variables preinitialized from mkuser)
#
cr_newsrc()
{
  if [ ! -d "$MK_HOME" ]
  then
    echo "$MK_HOME ist kein Directory?"
    return 1
  fi

  newsrcfile > $MK_HOME/.newsrc
  sleep 2
  chmod 700 $MK_HOME/.newsrc
  chgrp $MK_GID $MK_HOME/.newsrc
  chown $MK_UID $MK_HOME/.newsrc
  echo "$MK_HOME/.newsrc angelegt."
  return 0
}

##############################################################################
#
# delete .newsrc
#
rm_newsrc()
{
  if [ -f "$MK_HOME/.newsrc" ]
  then
    cd $MK_HOME
    rm -f .newsrc
    echo "$MK_HOME/.newsrc geloescht."
    return 0
  else
    echo "$MK_HOME/.newsrc konnte nicht geloescht werden."
    return 1
  fi
}

########## main

mode=$1

case "$mode" in
  create) cr_newsrc ; rc=$? ;;
  remove) rm_newsrc ; rc=$? ;;
esac

exit $rc

-- 
[ (Kristian Koehntopp) (Harmsstrasse 98) (2300 Kiel) (+49 431 676689) ]
/a{def}def /e{exch}a /p{currentpoint e pop}a /m{moveto}a /s{sub}a
/Times-BoldItalic findfont setfont 36 36 scale 0 4 m{p 12 2 index stringwidth
pop s 2 div e m show p 0 e 1 s dup 4 e s 4 div setgray m}forall showpage
Technical Details
Message-ID: <1993Jan29.134249.6673@black.toppoint.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!fub!tpki.toppoint.de!black.toppoint.de!kris
References: <1k20g1INN80@tamsun.tamu.edu>

Show Full Headers
Complete Article Headers
Message-ID: <1993Jan29.134249.6673@black.toppoint.de>
Subject: Re: unsubscribe ALL groups?
Date: Fri, 29 Jan 1993 13:42:49 GMT
From: kris@black.toppoint.de (Kristian Koehntopp)
References: <1k20g1INN80@tamsun.tamu.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!fub!tpki.toppoint.de!black.toppoint.de!kris
Newsgroups: news.software.nn
X-Excuse: X-Copyright wegen Emma, Suedwestpresse und /C'T/DISKUSSIONEN.
Organization: Toppoint Mailbox e.V.
X-Copyright: (C) Copyright 1993 Kristian Koehntopp -- All rights reserved.
 Reproduktion, auch auszugsweise, ausserhalb elektronischer,
 nichtkommerzieller Datennetze nur mit ausdruecklichem,
 schriftlichem Einverstaendnis des Autors.
Lines: 104