File: nnspew.sh

package info (click to toggle)
nn 6.7.3-8
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 2,508 kB
  • ctags: 3,199
  • sloc: ansic: 32,035; sh: 1,491; awk: 138; makefile: 98
file content (21 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# nnspew -- generate subject line database
#
# From: James A. Woods (ames!jaw), NASA Ames Research Center
#
# Updates the auxiliary 'subjects' file.  It must be activated regularly
# via a system-wide 'cron' or 'at' command, e.g.
#
# 	2 6,9,12,15,18,21 * * *  root /bin/nice /usr/lib/nn/nnspew

trap "rm -f $TMP/nnsubj$$* ; exit" 0 1 2 15

# We use a "secret" 'nn -SPEW' call to do the hard part:

if $BIN/nn -SPEW < /dev/null > $TMP/nnsubj$$a
then
	if sort -u $TMP/nnsubj$$a > $TMP/nnsubj$$b
	then
		mv $TMP/nnsubj$$b $DB/subjects
		chmod 644 $DB/subjects
	fi
fi