#! /bin/sh
#
# upclient	Start the uptimes.net reporting client
#
# Author:	Clinton Work <clinton@scripty.com>
#		Alex C. de Haas <alex@uptimes.net>
#
# Fixes:	Alex: ``$RETVAL'' instead of ``$REVAL'' at bottom line file.
#		Alex: ``upclient'' instead of ``inet'' in usage	text.
#
# chkconfig: 345 70 70
# description: Reports client uptime to uptimes.net
# processname: upclient
# pidfile: /var/run/upclient.pid
#

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting upclient: "
	daemon upclient
	RETVAL=$?

	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/upclient
	;;
  stop)
	echo -n "Stopping upclient: "
	killproc upclient
	RETVAL=$?

	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/upclient
	;;
  status)
	status upclient
	RETVAL=$?
	;;
  restart)
  	$0 stop
	$0 start
	RETVAL=$?
	;;
  reload)
	$0 restart
	RETVAL=$?
	;;
  *)
	echo "Usage: upclient {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL
