summaryrefslogtreecommitdiffstats
path: root/scripts/bluetooth.init
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-14 08:17:59 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-05-14 08:17:59 +0000
commita16c5df68407649eb2c190ab71ab0a0be25209e6 (patch)
tree5100eb5de44ca9d743ceadcaf33d30b010fbd8c1 /scripts/bluetooth.init
parentd0553fb41562838ff9ca9bf1c0f6602aa7df4ce0 (diff)
Use a simple init script
Diffstat (limited to 'scripts/bluetooth.init')
-rw-r--r--scripts/bluetooth.init74
1 files changed, 9 insertions, 65 deletions
diff --git a/scripts/bluetooth.init b/scripts/bluetooth.init
index f1bf358f..83260035 100644
--- a/scripts/bluetooth.init
+++ b/scripts/bluetooth.init
@@ -9,92 +9,36 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=bluetooth
DESC="Bluetooth subsystem"
-HCID_NAME=hcid
-SDPD_NAME=sdpd
-HIDD_NAME=hidd
+DAEMON_NAME=hcid
HID2HCI_NAME=hid2hci
-RFCOMM_NAME=rfcomm
-PAND_NAME=pand
-DUND_NAME=dund
-HCID_EXEC="`which $HCID_NAME || true`"
-SDPD_EXEC="`which $SDPD_NAME || true`"
-HIDD_EXEC="`which $HIDD_NAME || true`"
+DAEMON_EXEC="`which $DAEMON_NAME || true`"
HID2HCI_EXEC="`which $HID2HCI_NAME || true`"
-RFCOMM_EXEC="`which $RFCOMM_NAME || true`"
-PAND_EXEC="`which $PAND_NAME || true`"
-DUND_EXEC="`which $DUND_NAME || true`"
-HCID_ENABLE=true
-SDPD_ENABLE=false
-HIDD_ENABLE=false
+DAEMON_ENABLE=true
HID2HCI_ENABLE=false
-RFCOMM_ENABLE=false
-DUND_ENABLE=false
-PAND_ENABLE=false
-HCID_CONFIG="/etc/bluetooth/hcid.conf"
-RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"
-
-HIDD_OPTIONS=""
-DUND_OPTIONS=""
-PAND_OPTIONS=""
+DAEMON_CONFIG="/etc/bluetooth/hcid.conf"
[ -e /etc/default/bluetooth ] && . /etc/default/bluetooth
case "$1" in
start)
echo -n "Starting $DESC:"
- if $HCID_ENABLE && [ -x "$HCID_EXEC" ] && [ -f "$HCID_CONFIG" ] ; then
- if $SDPD_ENABLE ; then
- $HCID_EXEC -f $HCID_CONFIG
- else
- $HCID_EXEC -s -f $HCID_CONFIG
- fi
- echo -n " $HCID_NAME"
- fi
- if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then
- $SDPD_EXEC
- echo -n " $SDPD_NAME"
- fi
- if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then
- $HIDD_EXEC $HIDD_OPTIONS --server || true
- echo -n " $HIDD_NAME"
+ if $DAEMON_ENABLE && [ -x "$DAEMON_EXEC" ] && [ -f "$DAEMON_CONFIG" ] ; then
+ $DAEMON_EXEC -s -f $DAEMON_CONFIG
+ echo -n " $DAEMON_NAME"
fi
if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then
$HID2HCI_EXEC --tohci > /dev/null 2>&1 || true
echo -n " $HID2HCI_NAME"
fi
- if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" ] && [ -f "$RFCOMM_CONFIG" ] ; then
- $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true
- echo -n " $RFCOMM_NAME"
- fi
- if $DUND_ENABLE && [ -x "$DUND_EXEC" ] && [ -n "$DUND_OPTIONS" ] ; then
- $DUND_EXEC $DUND_OPTIONS
- echo -n " $DUND_NAME"
- fi
- if $PAND_ENABLE && [ -x "$PAND_EXEC" ] && [ -n "$PAND_OPTIONS" ] ; then
- $PAND_EXEC $PAND_OPTIONS
- echo -n " $PAND_NAME"
- fi
echo "."
;;
stop)
echo -n "Stopping $DESC:"
- killall $PAND_NAME > /dev/null 2>&1 || true
- echo -n " $PAND_NAME"
- killall $DUND_NAME > /dev/null 2>&1 || true
- echo -n " $DUND_NAME"
- if [ -x "$RFCOMM_EXEC" ] ; then
- $RFCOMM_EXEC release all > /dev/null 2>&1 || true
- echo -n " $RFCOMM_NAME"
- fi
- killall $HIDD_NAME > /dev/null 2>&1 || true
- echo -n " $HIDD_NAME"
- killall $SDPD_NAME > /dev/null 2>&1 || true
- echo -n " $SDPD_NAME"
- killall $HCID_NAME > /dev/null 2>&1 || true
- echo -n " $HCID_NAME"
+ killall $DAEMON_NAME > /dev/null 2>&1 || true
+ echo -n " $DAEMON_NAME"
echo "."
;;
*)