Error out if no volumes are specified instead of core-dumping.
[dragonfly.git] / etc / periodic / weekly / 330.catman
blob88e41f0d3326df17679b029f0fc3c433494ce1c2
1 #!/bin/sh -
3 # $FreeBSD: src/etc/periodic/weekly/330.catman,v 1.5.2.5 2002/04/15 00:44:16 dougb Exp $
4 # $DragonFly: src/etc/periodic/weekly/330.catman,v 1.2 2003/06/17 04:24:48 dillon Exp $
7 # If there is a global system configuration file, suck it in.
9 if [ -r /etc/defaults/periodic.conf ]
10 then
11 . /etc/defaults/periodic.conf
12 source_periodic_confs
15 case "$weekly_catman_enable" in
16 [Yy][Ee][Ss])
17 if [ ! -d /usr/share/man/cat1 ]
18 then
19 echo '$weekly_catman_enable is set but /usr/share/man/cat1' \
20 "doesn't exist"
21 rc=2
22 else
23 echo ""
24 echo "Reformatting manual pages:"
26 MANPATH=`/usr/bin/manpath -q`
27 if [ $? = 0 ]
28 then
29 if [ -z "${MANPATH}" ]
30 then
31 echo "manpath failed to find any manpath directories"
32 rc=3
33 else
34 man_locales=`/usr/bin/manpath -qL`
35 rc=0
37 # Preformat original, non-localized manpages
38 echo /usr/libexec/catman.local "$MANPATH" |
39 su -fm man || rc=3
41 # Preformat localized manpages.
42 if [ -n "$man_locales" ]
43 then
44 for i in $man_locales
46 echo /usr/libexec/catman.local -L \
47 "$MANPATH" | LC_ALL=$i su -fm man || rc=3
48 done
51 else
52 rc=3
54 fi;;
56 *) rc=0;;
57 esac
59 exit $rc