]>
Commit | Line | Data |
---|---|---|
c874b005 AM |
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/rc.d/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 status; then | |
19 | $script stop | |
20 | fi | |
21 | else | |
22 | if ! $script status; then | |
23 | $script start | |
24 | fi | |
25 | fi |