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