#!/bin/sh
#
# Start/Stop script for ServerMonitor
#
# Copyright 2004 Andrew Kaluzniacki. All Rights Reserved.
# http://drewk.net
#
# Edit these lines for your particular setup
HOST=www.host.com
PORT=80
INTERVAL=10
REFHOST=refhost
REFPORT=81
ADMIN=you@localhost
SMTPHOST=mail.localhost

if [ "$1" = "start" ] ; then
  nohup java -server -cp . 			\
		-Dsm.host="$HOST"		\
		-Dsm.port="$PORT"		\
		-Dsm.interval=$INTERVAL 	\
		-Dsm.refHost="$REFHOST"		\
		-Dsm.refPort="$REFPORT"		\
		-Dsm.adminEmail="$ADMIN"	\
		-Dsm.smtpHost="$SMTPHOST"	\
		 ServerMonitor >> log.out &
  echo $! > pid

elif [ "$1" = "stop" ] ; then
  kill -15 `cat pid`
  rm pid

else 

  echo "Usage: smctl.sh  ( command )"
  echo "  start     Start ServerMonitor"
  echo "  stop      Stop ServerMonitor"
  echo " "
  echo "Edit this file to set the parameters."
fi




