Created
January 11, 2016 20:15
-
-
Save bewest/df3df42926b73fc4f4eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bluez - bluetooth daemon | |
description "bluetooth daemon" | |
start on started dbus | |
stop on stopping dbus | |
env UART_CONF=/etc/bluetooth/uart | |
env RFCOMM_CONF=/etc/bluetooth/rfcomm.conf | |
# expect fork | |
# expect daemon | |
respawn | |
exec /usr/sbin/bluetoothd -E | |
post-start script | |
[ "$VERBOSE" = no ] && redirect='>/dev/null 2>&1' || redirect= | |
# start_uarts() | |
if [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ]; | |
then | |
grep -v '^#' $UART_CONF | while read i; do | |
eval "/usr/sbin/hciattach $i $redirect" || : | |
done | |
fi | |
# start_rfcomm() | |
if [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ; | |
then | |
# rfcomm must always succeed for now: users | |
# may not yet have an rfcomm-enabled kernel | |
eval "/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect" || : | |
fi | |
end script | |
post-stop script | |
# stop_uarts() | |
logger -t bluez "Stopping uarts" | |
killall hciattach >/dev/null 2>&1 || : | |
# stop_rfcomm() | |
logger -t bluez "Stopping rfcomm" | |
if [ -x /usr/bin/rfcomm ]; | |
then | |
eval "/usr/bin/rfcomm unbind all $redirect" || : | |
fi | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment