xref: /dragonfly/etc/periodic/weekly/320.whatis (revision 7d3e9a5b)
1#!/bin/sh -
2#
3# $FreeBSD: head/etc/periodic/weekly/320.whatis 73349 2001-03-02 16:52:14Z ru $
4#
5
6# If there is a global system configuration file, suck it in.
7#
8if [ -r /etc/defaults/periodic.conf ]
9then
10    . /etc/defaults/periodic.conf
11    source_periodic_confs
12fi
13
14case "$weekly_whatis_enable" in
15    [Yy][Ee][Ss])
16	echo ""
17	echo "Rebuilding whatis database:"
18
19	MANPATH=`/usr/bin/manpath -q`
20	if [ $? = 0 ]
21	then
22	    if [ -z "${MANPATH}" ]
23	    then
24		echo "manpath failed to find any manpage directories"
25		rc=3
26	    else
27		rc=0
28
29	        # Build whatis(1) database(s) for original, non-localized
30		#  manpages.
31		/usr/libexec/makewhatis.local "${MANPATH}" || rc=3
32	    fi
33	else
34	    rc=3
35	fi;;
36
37    *)  rc=0;;
38esac
39
40exit $rc
41