#! /bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start:  mmcdev
# Required-Stop:
# Default-Start:   3 4 5
# Default-Stop:
# Description:     HP Tattoo daemon.
### END INIT INFO

# Source function library.
. /etc/rc.status
. /etc/rc.config

test -x /usr/hpserver/bin/hptatsvc || exit 5

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_HPTAT="yes"
test "$START_HPTAT" = yes || exit 0

#
#	See how we were called.
#
rc_reset
case "$1" in
  start)
	echo -n 'Starting HP Tattoo daemon: '
	startproc /usr/hpserver/bin/hptatsvc
	rc_status -v
	;;
  stop)
	echo -n 'Stopping HP Tattoo daemon: '
	killproc /usr/hpserver/bin/hptatsvc
	rc_status -v
	;;
  reload|restart)
	$0 stop
	$0 start
	rc_status
	;;
  status)
        echo -n 'Checking for process hptatsvc: '
	checkproc /usr/hpserver/bin/hptatsvc
	rc_status -v
	;;
  *)
	echo "Usage: /etc/init.d/hptatsvc {start|stop|restart|reload|status}"
	exit 1
esac

rc_exit
