#!/bin/sh
# chkconfig: 35 50 50
# description: wsma_server is a tool to start or stop wsma.
#****************************************************************
#****************************************************************
# *	Copyright (C) 2003, Wistron Inc.  All Rights Reserved.
# *	File Name:		wsma_server
# *	Author:			Jerry Zhou
# *	Create Time: 	2003-06-03 11:41:37
# *	Last Update: 	2003-07-16 15:13:50 by Jerry Zhou 
#****************************************************************
. /etc/rc.d/init.d/functions

case "$1" in
  start)
	cd /usr/local/share/pegasus/bin/
	killall SMPowerCtrl 2>/dev/null
	./SMPowerCtrl &
	cd /usr/local/share/asmagent/wsma/
	./wsmartd &
	touch /var/lock/subsys/wsma_server
    ;;
  stop)
	killall SMPowerCtrl 2>/dev/null
	killall wsmartd 2>/dev/null
	;;
  status)
    status SMPowerCtrl | sed 's/SMPowerCtrl/power control agent/g'
    status wsmartd | sed 's/wsmartd/S.M.A.R.T. daemon/g'
    ;;
  *)
	echo "Usage: wsma_server {start|stop|status}"
	exit 1
esac

exit 0
