Magellan Linux

Annotation of /trunk/bluez/udev-bluetooth.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 846 - (hide annotations) (download) (as text)
Fri Jun 12 16:44:12 2009 UTC (14 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 913 byte(s)
-files and patches for bluez pkg

1 niro 846 #!/bin/sh
2     # $Header: /root/magellan-cvs/src/bluez/udev-bluetooth.sh,v 1.1 2009-06-12 16:44:12 niro Exp $
3     #
4     # bluetooth.sh: udev external RUN script
5     #
6     # Copyright:
7     # 2009 modified for use with Magellan-Linux - Niels Rogalla <niro@magellan-linux.de>
8     # 2005-2006 Henrik Brix Andersen <brix@gentoo.org>
9     # 2007 Petteri Räty <betelgeuse@gentoo.org>
10     # 2008 Tiziano Müller <dev-zero@gentoo.org>
11     # Distributed under the terms of the GNU General Public License v2
12    
13     script=/etc/rc.d/init.d/bluetoothd
14    
15     # find out where sysfs is mounted. exit if not available
16     sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
17     if [ "$sysfs" = "" ]; then
18     echo "sysfs is required"
19     exit 1
20     fi
21    
22     if [ ! -d $sysfs/class/bluetooth/hci[0-9]* -a ! -d $sysfs/bus/bluetooth/devices/hci[0-9]* ]; then
23     if $script status; then
24     IN_HOTPLUG=1 $script stop
25     fi
26     else
27     if ! $script status; then
28     IN_HOTPLUG=1 $script start
29     fi
30     fi