#!/bin/bash
#
# opis: UPSCLIENT dla Linux
#       uruchamia i zatrzymuje program UPS Monitor 2.0 Client.
#       program monitorujacy UPS firmy Fideltronik
#
#       
# nazwa procesu   : upsc
# konfiguracja    : /etc/ups_client/upsc.conf
# lokalizacja     : /etc/ups_client/
# autor programu  : Zbigniew Huber <huber@fideltornik.com.pl>
# www fideltronik : http://www.fideltronik.com.pl 
#
. /etc/rc.d/init.d/functions

RETVAL=0

case "$1" in
  start)
	echo -n "Uruchomienie UPS Monitor 2.0 Client: "
	daemon /etc/ups_client/upsc
	RETVAL=$?
	echo
	;;
  stop)
	echo -n "Zakonczenie pracy UPS Monitor 2.0 Client: "
	killproc upsc
	RETVAL=$?
	echo
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
	echo "Zastosownie: upsclient {start|stop|restart|reload}"
	exit 1
esac

exit $RETVAL