BSD 4_3 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 6 Oct 1984 08:45:42 +0000 (00:45 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 6 Oct 1984 08:45:42 +0000 (00:45 -0800)
Work on file usr/contrib/news/misc/restore.active

Synthesized-from: CSRG/cd1/4.3

usr/contrib/news/misc/restore.active [new file with mode: 0644]

diff --git a/usr/contrib/news/misc/restore.active b/usr/contrib/news/misc/restore.active
new file mode 100644 (file)
index 0000000..473a101
--- /dev/null
@@ -0,0 +1,18 @@
+: recreate the active file from readers .newsrc files
+: and from the existing articles
+
+lib=${1-/usr/lib/news}
+tmp=/tmp/$$
+: Find the highest numbered articles from the .newsrcs
+cat `sed 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*://
+s/:.*//' /etc/passwd | sort -u | sed 's;$;/.newsrc;' ` 2>/dev/null  | 
+sed '/:/!d
+s/:.*[,-]/ /
+s/: */ /'  >$tmp
+: in case there are groups no-one reads, look in the list of newsgroups
+sed 's/[       ].*/ 1/' $lib/newsgroups >>$tmp
+sort  +0 -1 +1nr  $tmp | sort -m +0u -1 | sed 's/$/ 00001 y/
+/^fa/s/y$/n/' >$lib/active
+: finally, scan the spool directory and fix up the active file.
+$lib/expire -u
+rm -f $tmp