Annotation of 43BSD/contrib/nntp/rrn/newsetup, revision 1.1.1.1

1.1       root        1: #!/bin/sh
                      2: # : newsetup.SH,v 4.3 85/05/01 11:43:05 lwall Exp $
                      3: # 
                      4: # :    newsetup.SH,v $
                      5: # Revision 4.3  85/05/01  11:43:05  lwall
                      6: # Baseline for release with 4.3bsd.
                      7: # 
                      8: 
                      9: export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
                     10: 
                     11: : syntax: newsetup
                     12: 
                     13: : System dependencies
                     14: : You will want to change the definitions below to reflect the distribution
                     15: : areas around you.  If you have more areas than this you will need to modify
                     16: : the sed below.
                     17: 
                     18: locorg="local"
                     19: organization="ucb"
                     20: city="ba"
                     21: state="ca"
                     22: cntry="usa"
                     23: cont="na"
                     24: active="/tmp/active.$$"
                     25: 
                     26: dotdir="${DOTDIR-${HOME-$LOGDIR}}"
                     27: rm -f $dotdir/.oldnewsrc
                     28: echo "Creating .newsrc in $dotdir to be used by news programs."
                     29: 
                     30: /usr/local/lib/rn/getactive $active
                     31: 
                     32: : NOTE: SED WILL NOT TAKE MORE THAN 10 WFILES, SO BEWARE
                     33: 
                     34: sort <$active | sed >/tmp/n.tmp$$      \
                     35:        -e 's/^\([^ ]*\) .*$/\1:/'      \
                     36:        -e '/^control:/{'               \
                     37:        -e "  w /tmp/n.test$$"  \
                     38:        -e '  d'                        \
                     39:        -e '}'                          \
                     40:        -e '/^junk:/{'                  \
                     41:        -e "  w /tmp/n.test$$"  \
                     42:        -e '  d'                        \
                     43:        -e '}'                          \
                     44:        -e '/test:/{'                   \
                     45:        -e "  w /tmp/n.test$$"  \
                     46:        -e '  d'                        \
                     47:        -e '}'                          \
                     48:        -e "/^net\./{"                  \
                     49:        -e "  w /tmp/n.net$$"           \
                     50:        -e '  d'                        \
                     51:        -e '}'                          \
                     52:        -e "/^mod\./{"                  \
                     53:        -e "  w /tmp/n.mod$$"           \
                     54:        -e '  d'                        \
                     55:        -e '}'                          \
                     56:        -e "/^$locorg\./{"              \
                     57:        -e "  w /tmp/n.$locorg$$"       \
                     58:        -e '  d'                        \
                     59:        -e '}'                          \
                     60:        -e "/^$organization\./{"        \
                     61:        -e "  w /tmp/n.$organization$$" \
                     62:        -e '  d'                        \
                     63:        -e '}'                          \
                     64:        -e "/^$city\./{"                \
                     65:        -e "  w /tmp/n.$city$$" \
                     66:        -e '  d'                        \
                     67:        -e '}'                          \
                     68:        -e "/^$state\./{"               \
                     69:        -e "  w /tmp/n.$state$$"        \
                     70:        -e '  d'                        \
                     71:        -e '}'                          \
                     72:        -e "/^fa\./{"                   \
                     73:        -e "  w /tmp/n.fa$$"            \
                     74:        -e '  d'                        \
                     75:        -e '}'
                     76: 
                     77: sed </tmp/n.tmp$$ >/tmp/n.local$$      \
                     78:        -e "/^$cntry\./{"               \
                     79:        -e "  w /tmp/n.$cntry$$"        \
                     80:        -e '  d'                        \
                     81:        -e '}'                          \
                     82:        -e "/^$cont\./{"                \
                     83:        -e "  w /tmp/n.$cont$$" \
                     84:        -e '  d'                        \
                     85:        -e '}'                          \
                     86:        -e "/^to\./{"                   \
                     87:        -e "  w /tmp/n.to$$"            \
                     88:        -e '  d'                        \
                     89:        -e '}'                          \
                     90:        -e "/\./{"                      \
                     91:        -e "  w /tmp/n.misc$$"  \
                     92:        -e '  d'                        \
                     93:        -e '}'
                     94: 
                     95: 
                     96: if /bin/test -s $dotdir/.newsrc ; then
                     97:     echo "Saving your current .newsrc as .oldnewsrc..."
                     98:     mv -f $dotdir/.newsrc $dotdir/.oldnewsrc
                     99: fi
                    100: 
                    101: : newsrc order determined here
                    102: cat \
                    103:     /tmp/n.local$$ \
                    104:     /tmp/n.$locorg$$ \
                    105:     /tmp/n.$organization$$ \
                    106:     /tmp/n.$city$$ \
                    107:     /tmp/n.$state$$ \
                    108:     /tmp/n.$cntry$$ \
                    109:     /tmp/n.$cont$$ \
                    110:     /tmp/n.mod$$ \
                    111:     /tmp/n.net$$ \
                    112:     /tmp/n.fa$$ \
                    113:     /tmp/n.misc$$ \
                    114:     /tmp/n.test$$ \
                    115: | uniq >$dotdir/.newsrc
                    116: 
                    117: rm -f  /tmp/n.to$$ \
                    118:        /tmp/n.tmp$$ \
                    119:        /tmp/n.local$$ \
                    120:        /tmp/n.$locorg$$ \
                    121:        /tmp/n.$organization$$ \
                    122:        /tmp/n.$city$$ \
                    123:        /tmp/n.$state$$ \
                    124:        /tmp/n.$cntry$$ \
                    125:        /tmp/n.$cont$$ \
                    126:        /tmp/n.mod$$ \
                    127:        /tmp/n.net$$ \
                    128:        /tmp/n.fa$$ \
                    129:        /tmp/n.misc$$ \
                    130:        /tmp/n.test$$ \
                    131:        /tmp/active.$$
                    132: 
                    133: cat <<'EOH'
                    134: Done.
                    135: 
                    136: If you have never used the news system before, you may find the articles
                    137: in net.announce.newuser to be helpful.  There is also a manual entry for rn.
                    138: 
                    139: To get rid of newsgroups you aren't interested in, use the 'u' command.
                    140: Type h for help at any time while running rn.
                    141: EOH

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.