]> Pileus Git - ~andy/sunrise/blob - net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script
net-wireless/bluez-utils: updated ebuild for bug 143154
[~andy/sunrise] / net-wireless / bluez-utils / files / bluez-utils-2.24-udev.script
1 #!/bin/sh
2 #
3 # bluetooth.sh: udev external RUN script
4 #
5 # Copyright 2005-2006 Henrik Brix Andersen <brix@gentoo.org>
6 # Distributed under the terms of the GNU General Public License v2
7
8 script=/etc/init.d/bluetooth
9
10 # Find out where sysfs is mounted. Exit if not available
11 sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
12 if [ "$sysfs" = "" ]; then
13     echo "sysfs is required"
14     exit 1
15 fi
16
17 if [ ! -d $sysfs/class/bluetooth/hci[0-9]* ]; then
18     if $script --quiet status; then
19         $script stop
20     fi
21 else
22     if ! $script --quiet status; then
23         $script start
24     fi
25 fi