#!/bin/ksh

	
# =======================================
# Script file to copy manuals onto a machine at sigmet which is about
# to go into the field.  Therefore the nfs link to the manuals will not
# work.
# Copy manual directory across, but only if we are not on the source machine,
# and only if the manuals directory is not a symbolic link.
#
HOSTNAME='hostname' ; HOSTNAME="${HOSTNAME%%.*}"

if [ ${HOSTNAME} != "haze" ] ; then
  if [ -h ${IRIS_ROOT}/manuals ] ; then
    echo "Viewable manuals are symbolicly linked, please remove link first."
  else
    echo "Installing viewable manuals..."

    cd ${IRIS_ROOT}
    if [ -r manuals ] ; then
      echo "   Deleting old versions..." ; rm -rf manuals
    else
      echo "   Creating manuals directory from scratch..."
    fi
    mkdir manuals

    echo "   Installing local copies..."
    REMSH haze cd /usr/sigmet/install ";" export IRIS_ROOT=/usr/sigmet ";" \
                ./make_iris_tape -stdout 4 | tar -xvf - ./manuals
  fi
fi
