olddir=`pwd`

cd ../../..

if [ ! -f etc/monitrc ] ; then
  echo "Failed to find monit `pwd` /etc/monit"
  cd $olddir
  exit 1
fi

compare_monit_file () {
  diff etc/monitrc $1
  if [ ! "$?" = "0" ] ; then
    cd $olddir
    exit 1
  fi
}

if [ -f etc/FULL ] ; then 
     compare_monit_file /nn/etc/scd/monitcfg/monitrc.full
elif [ -f etc/TL ] ; then 
    compare_monit_file /nn/etc/scd/monitcfg/monitrc.tl
else
    compare_monit_file /nn/etc/scd/monitcfg/monitrc.base
fi
exit 0
