#!/bin/sh
#
# put this line into your crontab (man crontab):
# 0,10,20,30,40,50 * * * * /path/to/muh-check >/dev/null 2>&1
# this will check for a running muh every 10 minutes
#
# $Id: muh-check,v 1.7 2002/03/24 09:40:18 sebk Exp $
#

MUHBIN=muh

# you must modify this if you have installed muh locally:
# MUHBIN=$HOME/muh/muh

cd $HOME/.muh/
if test -r pid; then
  pid=`cat pid`
  if `kill -USR1 $pid >/dev/null 2>&1`; then
    exit 0
  fi
  rm -f pid
fi
echo "reloading muh..."
$MUHBIN
exit 0
