#!/bin/sh


#-------------------------
# PREAPARE directories:

remotename=usr
localname=\.$remotename


RemoteDir=/$remotename
LocalDir=/$localname

mkdir $LocalDir

# PREPARE subdirectories:

SUBDIRS=`echo ${RemoteDir}/{sbin,bin,man,man/man[1-9n],lib}`





for originald in $SUBDIRS
do

# Generate the (local) sub-directory where we `mirror' to
copyd=`echo $originald|sed "s/$remotename/$localname/" `

mkdir $copyd
done 



#-----------------------
# NOW install the scripts:
cd script
cp -a updateNFScache* /usr/local/sbin/



#-----------------------
#INSTRUCTIONS

cat <<EOT
----------------------------------------------------
now, to exploit the "cache", it is NECESSARY to make these 3 steps (otherwise it has no sense) :

please add the following line to you crontab  (change to your taste):

0 05 * * *     updateNFScache -q"

... it means to run updateNFScache quietly (no output-logging) everyday at 5am.


please add the following line to you /etc/ld.so.conf at the beginning !!!!:
/.usr/lib

change your MANPATH, PATH variables to make the preference (best in your profile) !!
export MANPATH=/.usr/man:$MANPATH
export PATH=/.usr/bin:/.usr/sbin:$PATH

-------------------------------------------------------
EOT

cd ..
