summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script')
-rw-r--r--net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script25
1 files changed, 25 insertions, 0 deletions
diff --git a/net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script b/net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script
new file mode 100644
index 000000000..516c04664
--- /dev/null
+++ b/net-wireless/bluez-utils/files/bluez-utils-2.24-udev.script
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# bluetooth.sh: udev external RUN script
+#
+# Copyright 2005-2006 Henrik Brix Andersen <brix@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+script=/etc/init.d/bluetooth
+
+# 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]* ]; then
+ if $script --quiet status; then
+ $script stop
+ fi
+else
+ if ! $script --quiet status; then
+ $script start
+ fi
+fi