#!/bin/sh

LSOFDIR=${LSOF_BIN-"/afs/athena.mit.edu/contrib/watchmaker/arch/sun4x_55/bin"}
OSVER="`uname | tr '[A-Z]' '[a-z]'``uname -r`"
LSOF="${LSOFDIR}/lsof-${OSVER}"

if [ ! -x ${LSOF} ]; then
  for m in ${LSOFDIR}/lsof-*; do
    case "$m" in
      */lsof-\*) echo "LSOF is not compiled for `uname -s`."; exit 1 ;;
    esac
  done
  echo "LSOF is not compiled for `uname -s` version `uname -r`."; exit 1
fi

exec $LSOF "$@"
