#!/bin/sh
#
# put this line into your crontab (man crontab):
# 0,10,20,30,40,50 * * * * /home/user/check-muh >/dev/null 2>&1
# this will check for a running muh every 10 minutes
#
# $Id: check-muh,v 1.5 2000/03/10 19:10:02 zap Exp $
#

MUHBIN=$HOME/muh/muh

# MUHBIN=/usr/bin/muh

# this is where the muh-binary itself resides

# you don't need to modify anything below

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
