Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.