#!/bin/bash
#
# hpswvclt init script.
#
# chkconfig: 345 99 00
# description: HP Software Version collector.

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

test -x /usr/hpserver/bin/hpswvclt || exit 1

RETVAL=0

#
#	See how we were called.
#
case "$1" in
  start)
	# Check if hpswvclt is already running
	if [ ! -f /var/lock/subsys/hpswvclt ]; then
	    echo -n 'Starting HP Software Version collector: '
	    daemon /usr/hpserver/bin/hpswvclt
	    RETVAL=$?
	    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hpswvclt
	    echo
	fi
	;;
  stop)
	rm -f /var/lock/subsys/hpswvclt
	;;
  *)
	echo "Usage: /etc/rc.d/init.d/hpswvclt {start|stop}"
	exit 1
esac

exit $RETVAL
