#!/bin/sh # $Header: /root/magellan-cvs/src/bluez/udev-bluetooth.sh,v 1.1 2009-06-12 16:44:12 niro Exp $ # # bluetooth.sh: udev external RUN script # # Copyright: # 2009 modified for use with Magellan-Linux - Niels Rogalla # 2005-2006 Henrik Brix Andersen # 2007 Petteri Räty # 2008 Tiziano Müller # Distributed under the terms of the GNU General Public License v2 script=/etc/rc.d/init.d/bluetoothd # find out where sysfs is mounted. exit if not available sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'` if [ "$sysfs" = "" ]; then echo "sysfs is required" exit 1 fi if [ ! -d $sysfs/class/bluetooth/hci[0-9]* -a ! -d $sysfs/bus/bluetooth/devices/hci[0-9]* ]; then if $script status; then IN_HOTPLUG=1 $script stop fi else if ! $script status; then IN_HOTPLUG=1 $script start fi fi