makewhatis.local.sh revision 15755
1#!/bin/sh
2# (c) Wolfram Schneider, Berlin. April 1996. Public Domain.
3#
4# makewhatis.local - start makewhatis(1) only for file systems 
5#		     physically mounted on the system
6#
7# Running makewhatis from /etc/weekly for rw nfs-mounted /usr may kill
8# your NFS server -- all clients start makewhatis at the same time!
9# So use this wrapper instead calling makewhatis directly.
10#
11# PS: this wrapper works also for catman(1)
12#
13# $Id: makewhatis.local.sh,v 1.2 1996/04/27 12:17:01 wosch Exp $
14
15PATH=/bin:/usr/bin:$PATH; export PATH
16opt= dirs= localdirs=
17
18for arg
19do
20	case "$arg" in
21		-*) 	opt="$opt $arg";;
22		*)	dirs="$dirs $arg";;
23	esac
24done
25
26dirs=`echo $dirs | sed 's/:/ /g'`
27case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac
28
29localdirs=`find -H $dirs -fstype local -type d -prune -print`
30
31case X"$localdirs" in
32	X) 	echo "$0: no local-mounted manual directories found: $dirs"
33		exit 1;;
34	*) 	exec `basename $0 .local` $opt $localdirs;;
35esac
36