#!/usr/bin/env bash
#
# Copyright (C) 2003 VA Linux Systems Japan, K.K.
#
# LICENSE NOTICE
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#

# $Id: mon,v 1.1 2004/09/25 02:49:26 taru Exp $

set -e

eval `ultrapossum-config init`
trap "eval `ultrapossum-config term`" 0

# Source function library.
source_shell $HA_DIR/shellfuncs

stop () {
  /etc/init.d/mon stop
}

start() {
  /etc/init.d/mon start
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
  	$MODULEDIR/server/pid status "$MONPIDFILE"
	;;
  *)
	echo "Usage:$0 {start|stop|status}"
	exit 1
esac

