makewhatis.local.sh revision 50472
115755Swosch#!/bin/sh 215755Swosch# 317849Swosch# Copyright (c) April 1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. 417849Swosch# All rights reserved. 517849Swosch# 617849Swosch# Redistribution and use in source and binary forms, with or without 717849Swosch# modification, are permitted provided that the following conditions 817849Swosch# are met: 917849Swosch# 1. Redistributions of source code must retain the above copyright 1017849Swosch# notice, this list of conditions and the following disclaimer. 1117849Swosch# 2. Redistributions in binary form must reproduce the above copyright 1217849Swosch# notice, this list of conditions and the following disclaimer in the 1317849Swosch# documentation and/or other materials provided with the distribution. 1417849Swosch# 1517849Swosch# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1617849Swosch# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1717849Swosch# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1817849Swosch# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1917849Swosch# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2017849Swosch# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2117849Swosch# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2217849Swosch# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2317849Swosch# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2417849Swosch# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2517849Swosch# SUCH DAMAGE. 2617849Swosch# 2715755Swosch# makewhatis.local - start makewhatis(1) only for file systems 2815755Swosch# physically mounted on the system 2915755Swosch# 3049297Snik# Running makewhatis from /etc/periodic/weekly/320.whatis for rw nfs-mounted 3149297Snik# /usr may kill your NFS server -- all clients start makewhatis at the same 3249297Snik# time! So use this wrapper instead calling makewhatis directly. 3315755Swosch# 3415755Swosch# PS: this wrapper works also for catman(1) 3515755Swosch# 3650472Speter# $FreeBSD: head/usr.bin/makewhatis/makewhatis.local.sh 50472 1999-08-27 23:37:10Z peter $ 3715755Swosch 3815755SwoschPATH=/bin:/usr/bin:$PATH; export PATH 3915755Swoschopt= dirs= localdirs= 4015755Swosch 4115755Swoschfor arg 4215755Swoschdo 4315755Swosch case "$arg" in 4415755Swosch -*) opt="$opt $arg";; 4515755Swosch *) dirs="$dirs $arg";; 4615755Swosch esac 4715755Swoschdone 4815755Swosch 4915755Swoschdirs=`echo $dirs | sed 's/:/ /g'` 5015755Swoschcase X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac 5115755Swosch 5215755Swoschlocaldirs=`find -H $dirs -fstype local -type d -prune -print` 5315755Swosch 5415755Swoschcase X"$localdirs" in 5515755Swosch X) echo "$0: no local-mounted manual directories found: $dirs" 5615755Swosch exit 1;; 5715755Swosch *) exec `basename $0 .local` $opt $localdirs;; 5815755Swoschesac 59