#!/bin/sh

debug_mesg () {
    [ -n "$UDEV_LOG" ] && /usr/sbin/logger -t bluetooth "$@"
}


if [ "${ACTION}" = "add" ] 
then
	if [ ! -f /var/lock/subsys/bluetooth ]; then
	    debug_mesg "Initializing hci"
	    /sbin/hcid -i
	fi
	
	debug_mesg "Starting hidd"
	/etc/init.d/hidd start
fi

if [ "${ACTION}" = "del" ]
then
	debug_mesg "Stopping hidd"
	/etc/init.d/hidd stop
fi
