]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/periodic/weekly/320.whatis
Introduce /etc/defaults/periodic.conf, similar in concept to rc.conf.
[FreeBSD/FreeBSD.git] / etc / periodic / weekly / 320.whatis
1 #!/bin/sh -
2 #
3 # $FreeBSD$
4 #
5
6 # If there is a global system configuration file, suck it in.
7 #
8 if [ -r /etc/defaults/periodic.conf ]
9 then
10     . /etc/defaults/periodic.conf
11     source_periodic_confs
12 fi
13
14 case "$weekly_whatis_enable" in
15     [Yy][Ee][Ss])
16         if [ -x /usr/libexec/makewhatis.local -a -x /usr/bin/manpath ]
17         then
18             echo ""
19             echo "Rebuilding whatis database:"
20
21             MANPATH=`/usr/bin/manpath -q`
22             if [ $? = 0 ]
23             then
24                 if [ "x${MANPATH}" = "x" ]
25                 then
26                     echo "manpath failed to find any manpage directories"
27                 else
28                     man_locales=`/usr/bin/manpath -qL`
29
30                     # Build whatis(1) database(s) for original, non-localized
31                     #  manpages.
32                     /usr/libexec/makewhatis.local "${MANPATH}"
33
34                     # Build whatis(1) database(s) for localized manpages.
35                     if [ X"${man_locales}" != X ]
36                     then
37                         for i in ${man_locales}
38                         do
39                             LC_CTYPE=$i /usr/libexec/makewhatis.local -a \
40                                 -L "${MANPATH}"
41                         done
42                     fi
43                 fi
44             fi
45         fi;;
46 esac