#!/bin/sh
#
# dund:		Bluetooth Human Interface Device Daemon.
#
# chkconfig:	- 26 89
# description:	Bluetooth Human Interface Device Daemon. Provides keyboard,
#		mouse etc. functionality over Bluetooth.
#

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

. /etc/sysconfig/network

[ ${NETWORKING} = "no" ] && exit 0

[ -r /etc/sysconfig/hidd ] || exit 0

. /etc/sysconfig/hidd

[ -z "$HIDDARGS" ] && exit 0

start() 
{
        echo -n $"Starting hidd: "
        daemon /usr/bin/hidd $HIDDARGS

	touch /var/lock/subsys/hidd
        echo
}

stop() 
{
        echo -n $"Shutting down hidd: "
	/usr/bin/hidd -K
	killproc hidd

	rm -f  /var/lock/subsys/hidd
        echo
}

[ -f /usr/bin/hidd ] || exit 0

# See how we were called.
case "$1" in
  start)
	start
        ;;
  stop)
	stop
        ;;
  restart|reload)
	stop
	start
	;;
  condrestart)
	[ -e /var/lock/subsys/hidd ] && (stop; start)
	;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|condrestart}"
        exit 1
esac

exit 0
