330.catman revision 61981
1#!/bin/sh -
2#
3# $FreeBSD: head/etc/periodic/weekly/330.catman 61981 2000-06-23 01:18:31Z brian $
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_catman_enable" in
15    [Yy][Ee][Ss])
16	if [ -x /usr/libexec/catman.local -a -d /usr/share/man/cat1 -a \
17	     -x /usr/bin/manpath ]
18	then
19	    echo ""
20	    echo "Reformatting manual pages:"
21
22	    MANPATH=`/usr/bin/manpath -q`
23	    if [ $? = 0 ]
24	    then
25		if [ "x${MANPATH}" = "x" ]
26		then
27		    echo "manpath failed to find any manpath directories" 
28		else
29		    man_locales=`/usr/bin/manpath -qL`
30         
31		    # Preformat original, non-localized manpages  
32		    echo /usr/libexec/catman.local "$MANPATH" | su -fm man
33
34		    # Preformat localized manpages.
35		    if [ X"$man_locales" != X ]
36		    then
37			for i in $man_locales
38			do
39			    LC_CTYPE=$i echo /usr/libexec/catman.local -L \
40				"$MANPATH" | su -fm man
41			done
42		    fi
43		fi
44	    fi
45	fi;;
46esac
47