#!/bin/bash
#===============================================================================
# SSS Firmware
#===============================================================================
# File 			:	apcupsd
# Who			:	JWB
# Description		:	This script starts / stops apcupsd
# Copyright		:	LG ELECTRONICS INC.
# history 		:	2008.09.29 edited first
#===============================================================================
. /etc/sss_script/event/lib_sss

cd /etc/init.d/

check_status()
{
	if [ $? = 0 ]
	then
		echo "OK"
	else
		echo "FAILED"
	fi
}
case "$1" in
	start)
		echo -n "Starting apcupsd Daemon"
		echo
		UPS_Start
		check_status
		;;
	stop)
		echo -n "Stopping apcupsd Daemon"
		echo
		UPS_Stop
		check_status
		;;
	restart)
		echo -n "Restarting apcupsd Daemon"
		echo
		UPS_Restart
		check_status
		;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		;;
esac



