home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / bin / newsetup < prev    next >
Encoding:
Text File  |  1995-05-14  |  2.9 KB  |  99 lines

  1. #!/bin/sh
  2. # $Id: newsetup.SH,v 3.0 1992/02/01 03:09:32 davison Trn $
  3. # This software is Copyright 1991 by Stan Barber. 
  4. #
  5. # Permission is hereby granted to copy, reproduce, redistribute or otherwise
  6. # use this software as long as: there is no monetary profit gained
  7. # specifically from the use or reproduction of this software, it is not
  8. # sold, rented, traded or otherwise marketed, and this copyright notice is
  9. # included prominently in any copy made. 
  10. #
  11. # The author make no claims as to the fitness or correctness of this software
  12. # for any use whatsoever, and it is provided as is. Any use of this software
  13. # is at the user's own risk. 
  14.  
  15. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  16.  
  17. : syntax: newsetup
  18.  
  19. case undef in
  20. define)
  21.     # where recordings, distributions and moderators are kept
  22.     lib=`/usr/lib/trn/filexp /tmp`
  23.     # where important rn things are kept
  24.     rnlib=`/usr/lib/trn/filexp /usr/lib/trn`
  25.     nntplist=nntplist
  26.     ;;
  27. undef)
  28.     # where recordings, distributions and moderators are kept
  29.     lib="/tmp"
  30.     # where important rn things are kept
  31.     rnlib="/usr/lib/trn"
  32.     nntplist=/usr/bin/nntplist
  33.     ;;
  34. esac
  35.  
  36. test=test
  37. echo=/bin/echo
  38. cat=/bin/cat
  39. mv=/bin/mv
  40. rm=/bin/rm
  41. cp=/bin/cp
  42.  
  43. dotdir="${DOTDIR-${HOME-$LOGDIR}}"
  44. newsrc="$dotdir/.newsrc"
  45. tmp="${TMPDIR-/tmp}"
  46.  
  47. subs="$lib/subscriptions"
  48. tmpsubs="$tmp/trnsubs.$$"
  49.  
  50. $cat <<'EOH'
  51.  
  52. Welcome to trn.  Here's some important things to remember:
  53.  
  54.   o  Trn is an extension of rn and has a similar command syntax.
  55.   o  To access all the new features, specify the options -x and -X.  These
  56.      options MAY be on by default, but it won't hurt to be redundant.
  57.   o  Single-character commands don't require a carriage return -- only
  58.      commands that let you type in an argument.
  59.   o  At ANY prompt, you may type 'h' for help.  There are many different help
  60.      menus, depending on the context.  Also, typing <esc>h in the middle of a
  61.      multi-character command will list escape substitutions.
  62.   o  Typing a space to any prompt means to do the normal thing.  You could
  63.      spend all day reading news and never hit anything but the space bar.
  64.   o  If you have never used the news system before, you may find the articles
  65.      in news.announce.newusers to be helpful.
  66.   o  Please consult the man page for complete information.
  67.  
  68. EOH
  69.  
  70. $rm -f $newsrc-old
  71. $echo "Creating $newsrc to be used by news programs."
  72.  
  73. if $test -s "$newsrc"; then
  74.     $echo "Saving your current one as $newsrc-old..."
  75.     $mv -f $newsrc $newsrc-old
  76. fi
  77.  
  78. if $test -r $subs; then
  79.     $cp $subs $newsrc
  80. else
  81.     ($nntplist -o $tmpsubs subscriptions) >/dev/null 2>&1
  82.     if $test -s $tmpsubs; then
  83.     $cp $tmpsubs $newsrc
  84.     else
  85.     $cat <<EOM >$newsrc
  86. news.announce.newusers: 
  87. EOM
  88.     fi
  89.     $rm -f $tmpsubs
  90. fi
  91.  
  92. $cat <<'EOH'
  93. Done.
  94.  
  95. To add new group use "a pattern" or "g newsgroup.name".  To get rid of
  96. newsgroups you aren't interested in, use the 'u' command.
  97. EOH
  98.